Here, take some code from me to get you started. This is a simple trivia game. Replace the questions and answers with what you want to use.
This code might help you learn QBasic.
Code: Select all
1 CLS
CLEAR
GOSUB QUESTION1
GOSUB QUESTION2
QUESTION1:
LOCATE 1, 1:INPUT "What is the capital of Canada?", Q$
IF UCASE$(Q$) = "OTTAWA" THEN CLS
IF UCASE$(Q$) = "OTTAWA" THEN LOCATE 1, 1: PRINT "Correct!"
IF UCASE$(Q$) = "OTTAWA" THEN LOCATE 2, 1: PRINT "Press any key to continue . . ."
IF UCASE$(Q$) = "OTTAWA" THEN DO: LOOP WHILE INKEY$ = ""
IF UCASE$(Q$) = "OTTAWA" THEN RETURN
LOCATE 1, 1: PRINT "WRONG!"
LOCATE 2, 1: PRINT "Press any key to continue . . ."
DO: LOOP WHILE INKEY$ = ""
RETURN
QUESTION2:
LOCATE 1, 1:INPUT "What color is coal?", Q$
IF UCASE$(Q$) = "BLACK" THEN CLS
IF UCASE$(Q$) = "BLACK" THEN LOCATE 1, 1: PRINT "Correct!"
IF UCASE$(Q$) = "BLACK" THEN LOCATE 2, 1: PRINT "Press any key to continue . . ."
IF UCASE$(Q$) = "BLACK" THEN DO: LOOP WHILE INKEY$ = ""
IF UCASE$(Q$) = "BLACK" THEN RETURN
LOCATE 1, 1: PRINT "WRONG!"
LOCATE 2, 1: PRINT "Press any key to continue . . ."
DO: LOOP WHILE INKEY$ = ""
RETURN