+ 1

Sorting an Array

If I MAKE A RANDOM ARRAY OF INT’S, HOW CAN I MAKE SURE THAT ANY NUMBER IS PEAKED 1 TIME ONLY? IN OTHER WORDS, I WANT TO RANDOMLY PLACE NUMBERS FROM 1 TO 100 IN AN ARRAY, WITHOUT REPETITION.

21st Oct 2019, 11:58 AM
Sharon Keren
Sharon Keren - avatar
7 Respuestas
+ 2
Sharon Keren Why did you not tell us this was for sudoku?
21st Oct 2019, 2:16 PM
Trigger
Trigger - avatar
+ 2
sorry, i am new, will try better next time
21st Oct 2019, 2:54 PM
Sharon Keren
Sharon Keren - avatar
+ 1
Can you share your code here So I can tell by looking your code
21st Oct 2019, 12:40 PM
Programmer Raja
Programmer Raja - avatar
+ 1
var shuffled_numbers = Enumerable.Range(1,100).OrderBy(a => Guid.NewGuid()).ToList() Should work...I think
21st Oct 2019, 12:52 PM
Trigger
Trigger - avatar
0
shuffle wont work, i think. i want to build a soduko table 9x9. every square should be checked in its relative colum and row to see its not already used.
21st Oct 2019, 2:14 PM
Sharon Keren
Sharon Keren - avatar