Hello - I have a strange issue.. I'm going to try and layout my thought process, screenshots, issue as best as possible.
These arrays probably look weird and I will wind up remodeling them but for now this is what I came up with.
Questions Array
Answers Array
Initialize the array
I have a text box where basically it should scan Y = 0 and pick a random X to choose a random question in the questions array for the first row.
it stores the X that was picked in a variable.
The way the answers array is set up is that if the question that is asked is on questions(2,0) then the possible answers will be answers(2,0) , (2,1) and (2,2).
So I'm setting three buttons and checking to see if these values are duplicates in any of the buttons and then changes the value if it is.. so that the buttons display the three possible answers.
I can reload the page many times on the debug preview and everything works perfectly. However when I port to XCode and reload, almost every single time the button text is not right... Almost like its not reading the X index properly..
For example, the question is 10 + 10 = ? then the x index on questions is 3. It should return the numbers in answers array at answers(3,0) (3,1) and (3,2) which would be 20,10,21 in random order.. but instead my buttons texts will be like 10,20,4... this mix up only happens on IOS simulation but I never notice anything wrong with the code when I run on html debug layout.