+eirikub Posted December 6, 2015 Share Posted December 6, 2015 When checking if a given answer to an input is correct, I have this line of code: Wherigo.NoCaseEquals(input, answerGeo009) Is it possible to generalise this to Wherigo.NoCaseEquals(input, answer<name of current input>) ? If so, how do I write this correctly? Quote Link to comment
Ranger Fox Posted December 6, 2015 Share Posted December 6, 2015 If your answers were part of an array (really, a lookup table in lua), you could have done something like Wherigo.NoCaseEquals(input, myArray[index]). This allows you to ask questions from an array of questions or create a list of questions and answers to go through sequentially. That might be your best bet. You'll just have to store the array's index somewhere. Quote Link to comment
+eirikub Posted December 8, 2015 Author Share Posted December 8, 2015 If your answers were part of an array (really, a lookup table in lua), you could have done something like Wherigo.NoCaseEquals(input, myArray[index]). This allows you to ask questions from an array of questions or create a list of questions and answers to go through sequentially. That might be your best bet. You'll just have to store the array's index somewhere. Thank you. Do you know of any tutorials for this? On how to set up the code, I mean. Quote Link to comment
Ranger Fox Posted December 9, 2015 Share Posted December 9, 2015 How comfortable are you with code? Or would you like something that can be done within a builder application? I don't want to make it more complicated than you need. If you want to know more about arrays, you could look at the source code of my Battleship cartridge. That'll tell you a lot. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.