Randomize text position for 2D Quiz C#
Hi, I'm trying to do a Quiz game by my own. What I'm using are arrays (not ArrayLists) to store the questions and its options. So I have "chemic_Quesitons" a string[] with for example {"Iron", "Cupper"} and I have my other string[] array "options" with "Fe", "Cu", "Co", etc.
My problem: What I am trying to avoid is to don't show the same options on the same place each time, I want lets say option A be placed on the 1° button, option B on the 2° and for the next time I ask the same questions, I want for example option A be placed on the 3° button instead of the 1°. So what I want is to be able to rotate the elements of the array so when I assign them to the buttons, they will have a different possition each time.
What I've tried: I've tried using a For loop and using Random.Range to grab a random element of the "options" array and assign them to a button, this way each time would be different, but as I'm doing it on the Update() function, the elements are constantly being randomize, this causes the texts of each buttons to be constantly changing as the random functions is active all the time.
What I wanted to know is if there is a way to stop the random.range function so it grabs 4 random elements of the array and then it stops, or if there is another way of doing this.
The For loop is just a loop that gives each button a certain string for the "options" array. For example: The first 4° elements of the array would correspond the first quesiton. The second group of 4 to the next question and so on
If more details or information is needed please ask and I'll answer.
This is an example of what the game would be like: