We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi! I want to fill an array with 10 random numbers (from 1 to 20) but I don't want them to repeat.. Could anyone help me with the simplest code possible? I tried to do this using for and if but it didn't worked.. :/
Answers
How would you do this in real life? Think lottery or bingo...
https://Forum.Processing.org/two/discussions/tagged?Tag=fromrange(),shuffle()
Make a list of 10, shuffle them and then pick the first/top 10.
Check IntList in the reference.
Kf
Fail. "From 1 to 20" it says.