I’ve been googling Fisher Yates Shuffle and how to make it after one guy suggested it here for randomizing my strings.
I copied it from the internet, did some changed, but now I’m stuck again. When I debug.log(i) or try to print it out on screen, all i get is “i”. if I try debugging Questions I get System.String[ ]. So I’m basically stuck. What I wont to be printed out is one of the 3 strings i have
You’re not telling it to print a string from your array, you’re telling it to print ‘i’.
Debug.Log(i);
Prints the value of the variable ‘i’.
Debug.Log(Questions[i]);
Prints the value in the ‘Questions’ array at index ‘i’
I would suggest doing some cursory reading about arrays and collections and how to read/write from them. An array is just a series of values that you access by index. ‘i’ is just a number variable that you’re using to store what index to read. You don’t want to print ‘i’, you want to print the value that the array has at index ‘i’. ```csharp
*// don’t do this. i is the index you want to look at, not the string
GetToKnowText.text = i.ToString();
// do this. Get the string in the Questions array at index i
GetToKnowText.text = Questions[i];* ``` ^ same problem there, don’t get i as a string, get the value of questions at index ‘i’.