I have a text doc that I would like to pull strings from.
I got a simple code now to pull words at random and know when the end of the list is reached..
Now I want to know how you would do it if you wanted the data in pairs like a Q and A.
Here is what my text file looks like
The cat sat on the mat.
The dog fell off a log.
The bat is very fat.
So now I want the code to be able to go (at random) to the Q (e.g. dog) and then go to the A (The dog fell off the log) on the next mouse click.
I am using the array.length and then splicing the anwer already picked, so my array is constantly getting shorter (length==0 is how it knows the end is here)
Should I be using two lists? One for Questions and one for answers?
Thanks for any and all help!
Cheers and have a great day
Update.. I did it with two lists and it works well, but still wondering ... is this how a real code monkey would do it.