Re: How do I get this program to ask more than one question?

new topic     » goto parent     » topic index » view thread      » older message » newer message

You could also streamline your sequences. Keep in mind that sequences may be nested to any depth, which can help when iterating through lists like you're doing.

sequence questions, answers, correct 
  
questions = { 
    "WHO IS BURIED IN GRANT'S TOMB?", 
    "5 + 5 = ?", 
    "HOW MANY TEETH DOES AN ADULT HUMAN HAVE?", 
    "WHAT IS THE CAPITAL OF THE STATE OF FLORIDA?", 
    "APPROXAMENTALY HOW MILES IS IT TO THE SUN?"} 
 
answers = { 
    -- question 1 
    { "GRANT", 
      "LINCON", 
      "NOBODY", 
      "WASHINGTON" }, 
    -- question 2 
    { "5", 
      "10", 
      "25", 
      "50", 
    -- question 3 
    { "36", 
      "35", 
      "32", 
      "40" }, 
    -- question 4 
      "MIAMI", 
      "ORLANDO", 
      "JACKSONVILLE", 
      "TALLAHASSEE" }, 
    -- question 5 
    { "90,000,000", 
      "89,000,000", 
      "93,000,000", 
      "91,000,000" } } 
 
correct = { "A", "B", "C", "D", "C" } 


Then you could loop through them as such:

for i = 1 to length( questions ) do 
 
    -- question[i] 
 
    for j = 1 to length( answers[i] ) do 
 
        -- answers[i][j] 
 
    end for 
 
    -- correct[i] 
 
end for 

Just a tip. grin

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu