Skip to content

Instantly share code, notes, and snippets.

@Aidan25
Created May 27, 2014 01:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Aidan25/351d81540a71948473c5 to your computer and use it in GitHub Desktop.
Save Aidan25/351d81540a71948473c5 to your computer and use it in GitHub Desktop.
Coded with FutureBASIC 5
dim i
dim x
dim y
dim option
dim bck
dim coun$
dim capt$
dim max
dim maxcountry$
dim found
dim match
dim search$
dim Country$(100)
dim Capital$(100)
dim counter(100)
window 1, "Capitals & Countries Quiz", (0,0)-(1000,1000)
let x = 300
let y = 320
gosub "LoadArray"
gosub "MainMenu"
"LoadArray"
for i = 1 to 15
read Country$(i), Capital$(i), counter(i)
next i
return
"MainMenu"
text _newYork, 25
print% (250,40) "Welcome to the Capitals & Countries Quiz!"
delay 350
text _geneva, 18, _italicBit%
print% (430,80) "Difficulty: Diabolical"
print% (318,103) "WARNING: This program is case sensitive!"
text _newYork, 25, 0
print% (70,200) "1. Search for a Capital"
print% (70,240) "2. Capitals Quiz"
print% (70,280) "3. Countries Quiz"
print% (70,320) "4. Numbers of times each Country has been selected"
print% (70,360) "5. Quit"
print
input "Please select an option: "; option
if option = 1
gosub "CapitSearch"
end if
if option = 2
gosub "CapitalQuiz"
end if
if option = 3
gosub "CountQuiz"
end if
if option = 4
gosub "CountrySele"
end if
if option = 5
gosub "EndProg"
cls
end if
"CapitSearch"
cls
text _newYork, 22
let i = 1
print "Pitcairn Islands"
print "Wake Island"
print "Madagascar"
print "Tuvalu"
print "Federated States of Micronesia"
print "Kosovo"
print "Hungary"
print "Cape Verde"
print "Niue"
print "Mozambique"
print "Uzbekistan"
print "Kyrgyzstan"
print "Panau"
print "Suriname"
print
let i = i + 1
let found = 0
input "Please enter a country: "; search$
do
if search$ = Country(i)
let found = 1
let counter(i) = counter(i) + 1
print
print "Capital: " Capital(i)
else
let i = i + 1
end if
until i>15 or found = 1
print
input "Press enter to go back to the Main Menu."; bck
cls
gosub "MainMenu"
"CapitalQuiz"
cls
let i = 1
let match = 0
do
print "What is the capital of " Country$(i);
print
input " "; coun$
if coun$ = Capital$(i)
let match = 1
print
print
print "Correct!"
delay 1000
print "Next question..."
delay 1500
let i = i + 1
cls
else
let match = 0
print
print
print "Incorrect!"
delay 1000
print "Next question..."
delay 1500
let i = i + 1
cls
end if
until i>14
if i = 15
print "End of Quiz"
delay 1000
print "Returning to main menu..."
delay 2000
cls
gosub "MainMenu"
end if
"CountQuiz"
cls
let i = 1
let match = 0
do
print "Which country's capital is: " Capital$(i);
print
input " "; capt$
if capt$ = Country$(i)
let match = 1
print
print
print "Correct!"
delay 1000
print "Next question..."
delay 1500
let i = i + 1
cls
else
let match = 0
print
print
print "Incorrect!"
delay 1000
print "Next question..."
delay 1500
let i = i + 1
cls
end if
until i>14
if i = 15
print "End of Quiz"
delay 1000
print "Returning to main menu..."
delay 2000
cls
gosub "MainMenu"
end if
return
"CountrySele"
cls
text _newYork, 11
for i = 1 to 15
print Country$(i) " has been selected: "
print counter(i) " times"
print
next
gosub "FindMax"
input "Press enter to go back to the Main Menu."; bck
text _newYork, 14, _boldBit%
print "Returning to main menu..."
delay 2000
cls
gosub "MainMenu"
"FindMax"
let max = 0
for i = 1 to 15
if counter(i) > max
let max = counter(i)
let maxcountry$ = Country$(i)
end if
next
print "This country has been selected the most times: " maxcountry$, " ", max
return
"DrawText"
print% (x,y) "Created by Aidan, Year 10 �."
return
"EndProg"
cls
text _newYork, 28
print% (175,60) "Thank you for playing the Capital Cities Quiz!"
delay 700
for x = 70 to 600 step 3
color _zBlack
gosub "DrawText"
flushwindowbuffer
color _zWhite
gosub "DrawText"
next
stop
data Pitcairn Islands, Adamstown, 0
data Wake Island, Wake Island, 0
data Madagascar, Antananarivo, 0
data Tuvalu, Funafuti, 0
data Palau, Melekeok, 0
data Federated States of Micronesia, Palikir, 0
data Kosovo, Pristina, 0
data Hungary, Budapest, 0
data Cape Verde, Praia, 0
data Niue, Alofi, 0
data Mozambique, Maputo, 0
data Uzbekistan, Tashkent, 0
data Kyrgyzstan, Bishkek, 0
data Panau, Panau City, 0
data Suriname, Paramaribo, 0
//--All rights reserved, Aidan N. 2014--//
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment