View Single Post
Old Apr 29th, 2008, 11:53 AM   #2
Freaky Chris
Professional Programmer
 
Freaky Chris's Avatar
 
Join Date: Dec 2007
Location: England
Posts: 281
Rep Power: 1 Freaky Chris is on a distinguished road
Send a message via MSN to Freaky Chris
Re: populate array with random nonrepeating #'s

Should it not just be as simple as checking storing the last number to be generated and stored, then checking it agaisnt the new number to see if it is the same if it is then generate a new number?

Sorry, re-read you may want to store each randomly generated number in an array then check each new number against those in the array.

im confusing myself lol

Chris
__________________
Steven Skiena - Algorithms

,[->+>+<<]>>[-<<+>>]>++++++++[-<++++++++>]<+[-<->]>+<<[[-]+++++++++++++++.[-]>]>>[+++++++++.[-]],
brainf**k -- It's such a pretty language

Last edited by Freaky Chris; Apr 29th, 2008 at 12:04 PM.
Freaky Chris is offline   Reply With Quote