1 Reply Latest reply on Jul 27, 2013 3:28 PM by subtlefly72

    proper work flow for strings from external files

    subtlefly72

      Hi all,

      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

       

      cat

      The cat sat on the mat.

      dog

      The dog fell off a log.

      bat

      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

      sub