Generate random numbers without repeating a value: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 11:
Given the output of an existing random number generator that <i>does</i> produce repeated output, create a function that constrains the output to numbers 1 through 20 (inclusive), and no number is output more than once. (Technically it stops being "random" at that point, but that's beyond the scope of this task.) Try your best not to make the process take too long at runtime.
 
For the second version of the task, the random number generator itself need not be implemented; however you must specify its possible range of values before your constraint function is applied. (e.g "Assume the random number generator creates a value from 0 to 255, and values are allowed to repeat")
 
;Related Tasks
1,489

edits