3 ms·
> `random(x)` made me think x was the seed. Fair, but that would be bad design in my opinion. In general you want the random() function to be usable multiple t
by dheera 3y ago
> `random(x)` made me think x was the seed.
Fair, but that would be bad design in my opinion. In general you want the random() function to be usable multiple times to get the same sequence after setting the seed once, and not have to specify the seed every time.
- hot_gril 3y agoYeah, neither assumption makes much sense. Seeding should be a separate func, and range random should take two args. Just for some reason seed is the first thing that comes to mind. But now I see this page has editable code and whatever language it's in does have random(x) taking one arg. So fair enough.
- antonvs 3y agoIt’s in Processing. Its random function can take one arg (the max) or two args (the range). So what you suggested would be possible.