Now that you learned how to properly use GOTO lets try to avoid it.
As Deego pointed out you really should use arrays. They allow you to use the same commands to show all questions in the array in order. For a quiz game I'd use a multi-dimensional array to store the question, choices, and answer since they're all strings.
` Dimensionalize the multi-dimensional array
dim Question$(100,2)
This stores 101 sets of questions, choices, and answers (counting zero).
Here's the breakdown of what the array will store:
` Question$(xxx,0) = Question
` Question$(xxx,1) = Choices
` Question$(xxx,2) = Answer
You can define the array at the top of your code (after the dim statement):
` Define the array
` First Question
Question$(0,0)="What colour rhymes with poo?"
Question$(0,1)="Is your answer Blue or green (B/G)?"
Question$(0,2)="b"
` Second Question
Question$(1,0)="Who is the current Prime minister in England?"
Question$(1,1)="Is it Tony Blair or Gordan Brown (T/B)?"
Question$(1,2)="b"
` Third Question
Question$(2,0)="What is the command you want to always avoid using in Darkbasic?"
Question$(2,1)="Is it PRINT, GOTO, or INK (P/G/I)?"
Question$(2,2)="g"
So if you want to know what the answer is for the first question you look at Question$(0,2) or the choices of question 2 you look at Question$(1,1).
To go through all the questions you can use a FOR/NEXT loop which basically makes a variable equal a number range that it adds to or subtracts from every time it loops.
for t=0 to 2
cls
` Show the question
print Question$(t,0)
wait 3000
` Show the choices and wait for answer
input Question$(t,1),Answer$
` Convert Answer$
Answer$=left$(Lower$(Answer$),1)
next t
This is a FOR/NEXT loop that makes t=0 the first time it goes through the loop, then t=1 the second time, then t=2 the third time... once it hits the end of the FOR/NEXT loop it goes on to the next line under NEXT t.
Because all the questions and answers are in the array you can use a single IF/ENDIF statement to check every single answer (one answer per loop of the FOR/NEXT).
` Check if the answer is right (else it's wrong)
if Answer$=Question$(t,2)
` Right answer
print ""
print "Congrats you win this round!"
wait 3000
print ""
print "Press any key to go to round "+str$(t+2)+"."
wait key
else
` Wrong answer
print ""
print "Sorry champ maybe you will have better luck next time."
wait 2000
print ""
Print "Press any key to exit"
wait key
` End program
end
endif
This checks if Answer$ is equal to Question$(t,2) so the first time it goes through the FOR/NEXT loop it's checking if Answer$=Question$(0,2) which is "b". The third time it's looking at Question$(2,2) which is "g".
Here's everything above combined:
` Dimentionalize the multi-dimentional array
dim Question$(100,2)
` Question$(xxx,0) = Question
` Question$(xxx,1) = Choices
` Question$(xxx,2) = Answer
` Define the array
` First Question
Question$(0,0)="What colour rhymes with poo?"
Question$(0,1)="Is your answer Blue or green (B/G)?"
Question$(0,2)="b"
` Second Question
Question$(1,0)="Who is the current Prime minister in England?"
Question$(1,1)="Is it Tony Blair or Gordan Brown (T/B)?"
Question$(1,2)="b"
` Third Question
Question$(2,0)="What is the command you want to always avoid using in Darkbasic?"
Question$(2,1)="Is it PRINT, GOTO, or INK (P/G/I)?"
Question$(2,2)="g"
` Go through every question
for t=0 to 2
cls
` Show the question
print Question$(t,0)
wait 3000
` Show the choices and wait for answer
input Question$(t,1),Answer$
` Convert Answer$
Answer$=left$(Lower$(Answer$),1)
` Check if the answer is right (else it's wrong)
if Answer$=Question$(t,2)
` Right answer
print ""
print "Congrats you win this round!"
wait 3000
print ""
print "Press any key to go to round "+str$(t+2)+"."
wait key
else
` Wrong answer
print ""
print "Sorry champ maybe you will have better luck next time."
wait 2000
print ""
Print "Press any key to exit"
wait key
` End program
end
endif
next t