Randomizing an array

前端 未结 3 1655
栀梦
栀梦 2021-01-22 07:57

I wish to implement the Dr.D.E.Knuth\'s Subtractive RANDOM number generation algorithm. I wish to implement an ATM panel on which when very time user log-in the buttons will be

3条回答
  •  广开言路
    2021-01-22 08:41

    To set the position of the buttons randomly in the panel, instead of using n from 0 to 9 in the loop, you can use a random value from 0 to 9. Be sure you don't use the same value twice.

提交回复
热议问题