mardi 7 août 2018

Lua -randomly select 3 numbers (out of 250) in every run/event, but excluding one

I would like to get random 3 numbers (e.g. 3, 177, 244) from an array of 0 to 250 in every event, and excluding a pre-defined number between 0 and 250 (e.g 220).

For example,

  1. In the 1st event (push button), I got 220 from another data set, so I need random numbers like a=3, b=177, c=244 (a, b, c should not be 220).

  2. In the 2nd event (push button), I got 15 from another data set,, so I need random numbers like a=77, b=109, c=166 (a, b, c should not be 15)

Do you have any good idea to implement this? Looking for a good mathematician! Cheers.




Aucun commentaire:

Enregistrer un commentaire