This question already has an answer here:
- Making an array of random ints 2 answers
I have an array of prices all with a value of zero currently:
int[] prices = { 0, 0, 0, 0, 0, 0 };
I have been searching for a way to randomize each element of the array after a user clicks a button so that after each click element 0 becomes randomized to a unique value as will elements 2, 3 so on and so fourth, however, I can only figure out how to shuffle the array.
I'm very new to c# and the only way I can figure out how to do this is to create individual INT variables and randomize each value separately but this would make my code messy i think.
Is this possible?
Thanks,
Aucun commentaire:
Enregistrer un commentaire