HI,
I got this Provinces of Canada Quiz, you write your answers and so on. At the end you get your score in percent, now i need to create a graph that inserts the percentage results. I have no clue how to ge teh graph in.
CODE:
Turing: |
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
var answer : string
var s: int
s := 0
var font1 : int
font1 := Font.New ("Castellar:18")
assert font1 > 0
var font2 : int
font2 := Font.New ("Curlz MT:18")
assert font2 > 0
var font3 : int
font3 := Font.New ("Georgia:18")
assert font3 > 0
var font4 : int
font4 := Font.New ("Forte:18")
assert font4 > 0
%%%%%%%%%%%%%%%%%%%%%
proc bc
for decreasing c : 2 .. 0
% British Colombia
Font.Draw ("What is the Capital of British Colombia?", 20, 350, font1, 111)
locatexy (400, 300)
get answer
cls
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
Font.Draw (answer, 50, 150, font3, 36)
if answer = "Victoria" or answer = "victoria" then
Font.Draw ("WOOT -happy dance-", 400, 250, font2, 79)
s := s+ 1
delay (1000)
exit
else
Font.Draw ("YOU ARE SO...NOT RIGHT!", 350, 250, font4, 79)
Font.Draw ("Number of gueses left", 10, 10, font2, 38)
locatexy (230, 0)
put c
end if
if c = 0 then
cls
Font.Draw ("GAME OVER!", 50, 50, font2, 56)
end if
end for
cls
end bc
%%%%%%%%%%%%
proc ab
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
for decreasing c : 2 .. 0
% Alberta
Font.Draw ("What is the Capital of Alberta?", 20, 350, font1, 111)
locatexy (400, 300)
get answer
cls
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
Font.Draw (answer, 100, 120, font3, 36)
if answer = "Edmonton" or answer = "edmonton" then
Font.Draw ("RIGHTO", 400, 250, font2, 79)
s := s+ 1
delay (1000)
exit
else
Font.Draw ("hahaha... no", 350, 250, font4, 79)
Font.Draw ("Number of gueses left", 10, 10, font2, 38)
locatexy (230, 0)
put c
end if
if c = 0 then
cls
Font.Draw ("GAME OVER!", 50, 50, font2, 56)
end if
end for
cls
end ab
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc sas
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
for decreasing c : 2 .. 0
% Saskatchewan
Font.Draw ("What is the Capital of Saskatchewan?", 20, 350, font1, 111)
locatexy (400, 300)
get answer
cls
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
Font.Draw (answer, 150, 150, font3, 36)
if answer = "Regina" or answer = "regina" then
Font.Draw ("OH YA!", 400, 250, font2, 79)
s := s+ 1
delay (1000)
exit
else
Font.Draw ("NADA", 350, 250, font4, 79)
Font.Draw ("Number of gueses left", 10, 10, font2, 38)
locatexy (230, 0)
put c
end if
if c = 0 then
cls
Font.Draw ("GAME OVER!", 50, 50, font2, 56)
end if
end for
cls
end sas
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc man
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
for decreasing c : 2 .. 0
% Manitoba
Font.Draw ("What is the Capital of Manitoba?", 20, 350, font1, 111)
locatexy (400, 300)
get answer
cls
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
Font.Draw (answer, 190, 120, font3, 36)
if answer = "Winnipeg" or answer = "winnipeg" then
Font.Draw ("YAY!", 400, 250, font2, 79)
s := s+ 1
delay (1000)
exit
else
Font.Draw ("NOPE", 350, 250, font4, 79)
Font.Draw ("Number of gueses left", 10, 10, font2, 38)
locatexy (230, 0)
put c
end if
if c = 0 then
cls
Font.Draw ("GAME OVER!", 50, 50, font2, 56)
end if
end for
cls
end man
%%%%%%%%%%%%%%%%%%%%%%%%%%
proc ont
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
for decreasing c : 2 .. 0
% Ontario
Font.Draw ("What is the Capital of Ontario?", 20, 350, font1, 111)
locatexy (400, 300)
get answer
cls
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
Font.Draw (answer, 290, 50, font3, 36)
if answer = "Toronto" or answer = "toronto" then
Font.Draw ("Of course you know!", 400, 250, font2, 79)
s := s+ 1
delay (1000)
exit
else
Font.Draw ("Come on!", 350, 250, font4, 79)
Font.Draw ("Number of gueses left", 10, 10, font2, 38)
locatexy (230, 0)
put c
end if
if c = 0 then
cls
Font.Draw ("GAME OVER!", 50, 50, font2, 56)
end if
end for
cls
end ont
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc qu
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
for decreasing c : 2 .. 0
% Quebec
Font.Draw ("What is the Capital of Quebec?", 20, 350, font1, 111)
locatexy (400, 300)
get answer
cls
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
Font.Draw (answer, 350, 130, font3, 36)
if answer = "Quebec" or answer = "quebec" then
Font.Draw ("BIEN OUI!!", 400, 250, font2, 79)
s := s+ 1
delay (1000)
exit
else
Font.Draw ("ALLEZ, CE N'EST PAS DIFFICILE!", 350, 250, font4, 79)
Font.Draw ("Number of gueses left", 10, 10, font2, 38)
locatexy (230, 0)
put c
end if
if c = 0 then
cls
Font.Draw ("GAME OVER!", 50, 50, font2, 56)
end if
end for
cls
end qu
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc nb
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
for decreasing c : 2 .. 0
% New Brunswick
Font.Draw ("What is the Capital of New Brunswick?", 20, 350, font1, 111)
locatexy (400, 300)
get answer
cls
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
Font.Draw (answer, 400, 90, font3, 36)
if answer = "Fredericton" or answer = "fredericton" then
Font.Draw ("SCORE!!", 400, 250, font2, 79)
s := s+ 1
delay (1000)
exit
else
Font.Draw ("MISS!", 350, 250, font4, 79)
Font.Draw ("Number of gueses left", 10, 10, font2, 38)
locatexy (230, 0)
put c
end if
if c = 0 then
cls
Font.Draw ("GAME OVER!", 50, 50, font2, 56)
end if
end for
cls
end nb
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc ns
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
for decreasing c : 2 .. 0
% Quebec
Font.Draw ("What is the Capital of Nova Scotia?", 20, 350, font1, 111)
locatexy (400, 300)
get answer
cls
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
Font.Draw (answer, 450, 90, font3, 36)
if answer = "Halifax" or answer = "halifax" then
Font.Draw ("HIT!!", 400, 250, font2, 79)
s := s+ 1
delay (1000)
exit
else
Font.Draw ("SUNK!", 350, 250, font4, 79)
Font.Draw ("Number of gueses left", 10, 10, font2, 38)
locatexy (230, 0)
put c
end if
if c = 0 then
cls
Font.Draw ("GAME OVER!", 50, 50, font2, 56)
end if
end for
cls
end ns
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc pei
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
for decreasing c : 2 .. 0
% pei
Font.Draw ("What is the Capital of PEI?", 20, 350, font1, 111)
locatexy (400, 300)
get answer
cls
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
Font.Draw (answer, 430, 100, font3, 36)
if answer = "Charlottetown" or answer = "charlottetown" then
Font.Draw ("YUPPERS!", 400, 250, font2, 79)
s := s+ 1
delay (1000)
exit
else
Font.Draw ("BLAH NO!", 350, 250, font4, 79)
Font.Draw ("Number of gueses left", 10, 10, font2, 38)
locatexy (230, 0)
put c
end if
if c = 0 then
cls
Font.Draw ("GAME OVER!", 50, 50, font2, 56)
end if
end for
cls
end pei
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc nl
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
for decreasing c : 2 .. 0
% Newfoundland and Labrador
Font.Draw ("What is the Capital of Newfoundland and Labrador?", 20, 350, font1, 111)
locatexy (400, 300)
get answer
cls
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
Font.Draw (answer, 450, 150, font3, 36)
if answer = "St.John's" or answer = "st.John's" then
Font.Draw ("Thumbs UP!!", 400, 250, font2, 79)
s := s+ 1
delay (1000)
exit
else
Font.Draw ("Thumbds Down!", 350, 250, font4, 79)
Font.Draw ("Number of gueses left", 10, 10, font2, 38)
locatexy (230, 0)
put c
end if
if c = 0 then
cls
Font.Draw ("GAME OVER!", 50, 50, font2, 56)
end if
end for
cls
end nl
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc nt
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
for decreasing c : 2 .. 0
% Northwest Territories
Font.Draw ("What is the Capital of Northwest Territories?", 20, 350, font1, 111)
locatexy (400, 300)
get answer
cls
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
Font.Draw (answer, 150, 200, font3, 36)
if answer = "Yellowknife" or answer = "yellowknife" then
Font.Draw ("GOOD!", 400, 250, font2, 79)
s := s+ 1
delay (1000)
exit
else
Font.Draw ("BAD!", 350, 250, font4, 79)
Font.Draw ("Number of gueses left", 10, 10, font2, 38)
locatexy (230, 0)
put c
end if
if c = 0 then
cls
Font.Draw ("GAME OVER!", 50, 50, font2, 56)
end if
end for
cls
end nt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc nu
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
for decreasing c : 2 .. 0
% Nunavut
Font.Draw ("What is the Capital of Nunavut?", 20, 350, font1, 111)
locatexy (400, 300)
get answer
cls
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
Font.Draw (answer, 300, 230, font3, 36)
if answer = "Iqualuit" or answer = "Iqualuit" then
Font.Draw ("Positive!!", 400, 250, font2, 79)
s := s+ 1
delay (1000)
exit
else
Font.Draw ("Negative!", 350, 250, font4, 79)
Font.Draw ("Number of gueses left", 10, 10, font2, 38)
locatexy (230, 0)
put c
end if
if c = 0 then
cls
Font.Draw ("GAME OVER!", 50, 50, font2, 56)
end if
end for
cls
end nu
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
proc yu
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
for decreasing c : 2 .. 0
% Yukon
Font.Draw ("What is the Capital of Yukon?", 20, 350, font1, 111)
locatexy (400, 300)
get answer
cls
Pic.ScreenLoad ("Map.jpg", 50, 10, picMerge)
Font.Draw (answer, 70, 230, font3, 36)
if answer = "Whitehorse" or answer = "whitehorse" then
Font.Draw ("YES!", 400, 250, font2, 79)
s := s+ 1
delay (1000)
exit
else
Font.Draw ("NO!", 350, 250, font4, 79)
Font.Draw ("Number of gueses left", 10, 10, font2, 38)
locatexy (230, 0)
put c
end if
if c = 0 then
cls
Font.Draw ("GAME OVER!", 50, 50, font2, 56)
end if
end for
cls
end yu
proc score
put "Your score is..."
put s/ 13* 100
end score
bc
ab
sas
man
ont
qu
nb
ns
pei
nl
nu
nt
yu
score
|
|