Random Number Generator

Sharky Forums


Results 1 to 2 of 2

Thread: Random Number Generator

  1. #1
    Tiger Shark catch22's Avatar
    Join Date
    Mar 2003
    Location
    SF
    Posts
    649

    Random Number Generator

    I program in c++. I made a program that producded a random number between 0-100. Is there a way that i can make it so that when the number is generated it cancels that number out so that it dosen't print it out again?

  2. #2
    Reef Shark BlueChair's Avatar
    Join Date
    Oct 2002
    Location
    Indianapolis , IN
    Posts
    443
    I suppose you could input every number into an array or something... then everytime you get a new number have it check it against the array... if it is in the array then have it generate a new one... and so on...

    i think that would work...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •