+ 2
How to fix this random number genetator
It works in C++, but I can' t get it to work here. int[] item = new int[20]; int[] number = new int[20]; Random r = new Random(); for(int i=0; i<20; i++) { item[i] = i; } for(int x=20; ×>0; x--) { r.Next(0, x); number[x-1] = item[r]; while( r < x ) /* this is moving numbers from higher array to lower */ { item[r] = item[r+1]; r++; } }
2 Réponses
+ 1
Thank you a lot. (hvala)
0
good luck