Reputation: 25
I need to shuffle a char array and have a string array that contains words "play" and "game" and have some buttons in my game like this: image1
and this is my code:
for (int i = 0; i < Answers.Length; i++) {
BtnsCharacter = Answers [i].ToCharArray ();
}
but I need is to make a mess in my buttons arraignment wile converting to char in random in every level. like the image bellow for example:
How could I do that
Upvotes: 1
Views: 97
Reputation: 26
The answer not from Symon. From Me.
Anyway you have to reference the LINQ Namespace
Upvotes: 0
Reputation: 26
for (int i = 0; i < Answers.Length; i++) {
char[] BtnsCharacter = Answers [i].ToCharArray ();
char[] shuffled = BtnsCharacter.OrderBy(n => Guid.NewGuid()).ToArray();
}
Upvotes: 1