Posted: Tue Jan 03, 2006 6:58 pm Post subject: (No subject)
i like the graphics that your doing since turing isn't easy to do graphics on. suggestions would be:
1)let the user see wat answer they're typing
2)error proof it!!! (Don't allow letters, b/c program crashes)
3)when u get the answer wrong and u display the correct one it cuts off so u can't really see it. just change the text size to a bit smaller.
4)have statistics of how many u got right and how many wrong.
5)when user is playing the game have a button where they could exit, else keep randomizing equations.
solblade05
Posted: Tue Jan 03, 2006 7:13 pm Post subject: (No subject)
thanks, that the first feedback. phew...
i can figure out how to do all of them except the not accepting letter. Do i use If statements, and i do how do i use them? thanks, if anyone helps...
code:
setscreen ("graphics:750;750, nocursor, noecho")
% Star Variable
var s : int
var s1 : int
% Done By
var f2 : int := Font.New ("Ignacio:22:bold") % Font Information
assert f2 > 0 % Make Sure Font Is Made
% Adding
var f4 : int := Font.New ("Ignacio:14")
assert f4 > 0
% Subtract
var f5 : int := Font.New ("Ignacio:14") % Font Information
assert f5 > 0 % Make Sure Font Is Made
% Multiply
var f6 : int := Font.New ("Ignacio:14") % Font Information
assert f6 > 0 % Make Sure Font Is Made
% Divide
var f7 : int := Font.New ("Ignacio:14") % Font Information
assert f7 > 0 % Make Sure Font Is Made
% Exit
var f8 : int := Font.New ("Ignacio:14") % Font Information
assert f8 > 0 % Make Sure Font Is Made
% Credits
var f9 : int := Font.New ("Ignacio:40:bold") % Font Information
assert f9 > 0 % Make Sure Font Is Made
var f10 : int := Font.New ("Ignacio:16:bold")
assert f10 > 0
var f11 : int := Font.New ("Ignacio:16:bold") % Font Information
assert f11 > 0 % Make Sure Font Is Made
% Click To Start Instruction
var f12 : int := Font.New ("Ignacio:12") % Font Information
assert f12 > 0 % Make Sure Font Is Made
% Variable For When Box Not Clicked On The Menu
var f13 : int := Font.New ("Ignacio:10") % Font Information
assert f13 > 0 % Make Sure Font Is Made
% Variable For Select Level (Addition)
var f14 : int := Font.New ("Ignacio:36") % Font Information
assert f14 > 0 % Make Sure Font Is Made
% Back (Addition)
var f15 : int := Font.New ("Ignacio:16")
assert f15 > 0
% Easy (Addition)
var f16 : int := Font.New ("Ignacio:16")
assert f16 > 0
% Normal (Addition)
var f17 : int := Font.New ("Ignacio:16")
assert f17 > 0
% Hard (Addition)
var f18 : int := Font.New ("Ignacio:16")
assert f18 > 0
% Varaiable For buttonwait
var x : int
var y : int
var bnum : int
var bud : int
var a : int
var b : int
var c : int
var ans : int
const NUM_OF_QUESTIONS := 5
var temp : int
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Addition %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if x > 85 and x < 223 and y > 275 and y < 375 then
if x > 305 and x < 440 and y > 275 and y < 375 then % Easy
colorback (53)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 9)
randint (b, 0, 9)
Font.Draw (intstr (a) + " + " + intstr (b) + " = ", 285, 565, f14, black)
get ans
Font.Draw (intstr (a) + " + " + intstr (b) + " = " + intstr (ans), 285, 565, f14, black)
if ans = a + b then
Font.Draw ("Correct!", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a + b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
end for
elsif x > 305 and x < 440 and y > 170 and y < 270 then % Normal
colorback (68)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 30)
randint (b, 0, 30)
Font.Draw (intstr (a) + " + " + intstr (b) + " = ", 90, 565, f14, black)
get ans
Font.Draw (intstr (a) + " + " + intstr (b) + " = " + intstr (ans), 90, 565, f14, black)
if ans = a + b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a + b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
end for
elsif x > 305 and x < 440 and y > 65 and y < 165 then % Hard
colorback (40)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, -10, 30)
randint (b, -10, 30)
Font.Draw (intstr (a) + " + " + intstr (b) + " = ", 90, 565, f14, black)
get ans
Font.Draw (intstr (a) + " + " + intstr (b) + " = " + intstr (ans), 90, 565, f14, black)
if ans = a + b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a + b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
end for
else
exit
end if
delay (500)
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Addition End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Subtraction %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elsif x > 235 and x < 373 and y > 275 and y < 375 then
if x > 305 and x < 440 and y > 275 and y < 375 then % Easy
colorback (53)
for o : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 9)
randint (b, 0, 9)
if b > a then
temp := b
b := a
a := temp
end if
Font.Draw (intstr (a) + " - " + intstr (b) + " = ", 285, 565, f14, black)
get ans
Font.Draw (intstr (a) + " - " + intstr (b) + " = " + intstr (ans), 285, 565, f14, black)
if ans = a - b then
Font.Draw ("Correct!", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a - b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
end for
elsif x > 305 and x < 440 and y > 170 and y < 270 then % Normal
colorback (68)
for o : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 30)
randint (b, 0, 30)
if b > a then
temp := b
b := a
a := temp
end if
Font.Draw (intstr (a) + " - " + intstr (b) + " = ", 90, 565, f14, black)
get ans
Font.Draw (intstr (a) + " - " + intstr (b) + " = " + intstr (ans), 90, 565, f14, black)
if ans = a - b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a - b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
end for
elsif x > 305 and x < 440 and y > 65 and y < 165 then % Hard
colorback (40)
for o : 1 .. NUM_OF_QUESTIONS
cls
randint (a, -10, 20)
randint (b, -10, 20)
Font.Draw (intstr (a) + " - " + intstr (b) + " = ", 90, 565, f14, black)
get ans
Font.Draw (intstr (a) + " - " + intstr (b) + " = " + intstr (ans), 90, 565, f14, black)
if ans = a - b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a - b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
end for
else
exit
end if
delay (500)
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Subtract End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Multplication %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elsif x > 385 and x < 520 and y > 275 and y < 375 then
if ans = a * b then
Font.Draw ("Correct!", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
end for
elsif x > 305 and x < 440 and y > 170 and y < 270 then % Normal
colorback (68)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 10)
randint (b, 0, 10)
Font.Draw (intstr (a) + " * " + intstr (b) + " = ", 90, 565, f14, black)
get ans
Font.Draw (intstr (a) + " * " + intstr (b) + " = " + intstr (ans), 90, 565, f14, black)
if ans = a * b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
end for
elsif x > 305 and x < 440 and y > 65 and y < 165 then % Hard
colorback (40)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, -5, 10)
randint (b, -5, 10)
Font.Draw (intstr (a) + " * " + intstr (b) + " = ", 90, 565, f14, black)
get ans
Font.Draw (intstr (a) + " * " + intstr (b) + " = " + intstr (ans), 90, 565, f14, black)
if ans = a * b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
end for
else
exit
end if
delay (500)
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Multiply End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Divide %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elsif x > 530 and x < 665 and y > 275 and y < 375 then
loop
if x > 305 and x < 440 and y > 275 and y < 375 then % Easy
colorback (53)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 8)
randint (b, 0, 8)
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = ", 285, 565, f14, black)
get ans
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = " + intstr (ans), 285, 565, f14, black)
if ans = a * b div a then
Font.Draw ("Correct!", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b div a), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
end for
elsif x > 305 and x < 440 and y > 170 and y < 270 then % Normal
colorback (68)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 10)
randint (b, 0, 10)
Font.Draw (intstr (a * b) + " * " + intstr (a) + " = ", 90, 565, f14, black)
get ans
Font.Draw (intstr (a * b) + " * " + intstr (a) + " = " + intstr (ans), 90, 565, f14, black)
if ans = a * b div a then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b div a), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
end for
elsif x > 305 and x < 440 and y > 65 and y < 165 then % Hard
colorback (40)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, -5, 10)
randint (b, -5, 10)
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = ", 90, 565, f14, black)
get ans
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = " + intstr (ans), 90, 565, f14, black)
if ans = a * b div a then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Right Answer Is " + intstr (a * b div a), 80, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
end for
else
exit
end if
delay (500)
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Divide End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Exit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elsif x > 310 and x < 445 and y > 165 and y < 265 then
cls
delay (500)
drawfillbox (0, 0, 750, 750, white)
Font.Draw ("Magic Math", 290, 600, f9, 43)
Font.Draw ("Done By: Jawad Khan", 280, 500, f10, 43)
Font.Draw ("Infor-Games, In Cooperation With", 110, 400, f11, 43)
Pic.ScreenLoad ("EA2.jpg", 205, 125, picCopy)
delay (500)
exit
end if
delay (500)
Music.PlayFileStop
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Exit End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5%%%%%%%%%%%%%%%%%%%%%
DIIST
Posted: Tue Jan 03, 2006 10:02 pm Post subject: (No subject)
Try this. It will help the program chrash less!
code:
%Use this procedure!!!
proc getint (var interger_varible : int)
var temp : string
get temp%Takes input as string
%Checks if its Safe to convert
if strrealok (temp) then %Note used converts to real so 15.5 is still valid number
interger_varible := round (strreal (temp))%Rounds real number into interger
else
interger_varible := 0 %So program still runs!!!
end if
end getint
var answer : int
%Example of Use
getint (answer)
put answer %Regardless of what the enter it will not crash!!
cool dude
Posted: Tue Jan 03, 2006 11:33 pm Post subject: (No subject)
i believe theres a really good tuturial on error proofing check into it. if your still having trouble post again and i will try to explain better on error proofing
solblade05
Posted: Wed Jan 04, 2006 11:04 am Post subject: (No subject)
I looked at the tutorials and sort of understood the basics, (bith the array and error proofing), but i still cant figure out where to insrt them in my code, also how do i make them both compatible with fot.draw
pavol
Posted: Wed Jan 04, 2006 12:39 pm Post subject: (No subject)
if i've created programs in the past that have to do with getting integer values, and i don't want the program to crash i do sort of like what thuvs suggested except i don't use procedures and stuff, i just declare the variables as strings from the start and when i need to use them in mathematical 'ways' i just use strint(the variable).
Sponsor Sponsor
solblade05
Posted: Wed Jan 04, 2006 1:26 pm Post subject: (No subject)
yeah i know, but i dont know how to put that in my code
I'm also using Font.Draw. Please refer to my code above, tell me where and what to add, you dont have to add it in for me but atleast i'll know what to do...
I'm an extreme noob in turing please give me alot of help....
pavol
Posted: Thu Jan 05, 2006 11:31 am Post subject: (No subject)
just change your ans variable to be declared as a string instead and when you're testing for a value like you do here:
code:
if ans = a + b then
Font.Draw ("Correct!", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a + b), 90, 400, f14, black)
end if
you can use strintok(), which checks if the value can safely be converted and returns either a true or false value, and strint(), which changes the value from a string to an integer, like this:
code:
if strintok(ans) then
if strint(ans) = a + b then
Font.Draw ("Correct", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a + b), 90, 400, f14, black)
end if
and Font.Draw seems fine to me
cool dude
Posted: Thu Jan 05, 2006 5:26 pm Post subject: (No subject)
k since u didn't fix the words cutting of the way u fix it is by increasing the first number in your setscreen
code:
setscreen ("graphics:850;750, nocursor, noecho")
anyways in order to make sure they don't enter any letters u can make a function checking the "ans"
code:
function ValidInt : int
var ans : string % User's input - can be anything
get ans
%keep asking for input until it is a valid integer
loop
exit when strintok (ans)
colour (0)
put "Not a valid difficulty level, try again"
View.Update
get ans
end loop
%Sends the result to the main program
result strint (ans)
end ValidInt
Dont forget to decalre ans as string instead of int!!!
solblade05
Posted: Fri Jan 06, 2006 12:02 am Post subject: (No subject)
OK This is what i have so far...
code:
setscreen ("graphics:750;750, nocursor, noecho")
%Stars
var q : int
var w : int
% Done By
var f2 : int := Font.New ("Ignacio:22:bold") % Font Information
assert f2 > 0 % Make Sure Font Is Made
% Adding
var f4 : int := Font.New ("Ignacio:16") % Font Information
assert f4 > 0 % Make Sure Font Is Made
% Menu
var f3 : int := Font.New ("Ignacio:44") % Font Information
assert f3 > 0 % Make Sure Font Is Made
% Subtract
var f5 : int := Font.New ("Ignacio:16") % Font Information
assert f5 > 0 % Make Sure Font Is Made
% Multiply
var f6 : int := Font.New ("Ignacio:16") % Font Information
assert f6 > 0 % Make Sure Font Is Made
% Divide
var f7 : int := Font.New ("Ignacio:16") % Font Information
assert f7 > 0 % Make Sure Font Is Made
% Exit
var f8 : int := Font.New ("Ignacio:16") % Font Information
assert f8 > 0 % Make Sure Font Is Made
% Credits
var f9 : int := Font.New ("Ignacio:50:bold") % Font Information
assert f9 > 0 % Make Sure Font Is Made
var f10 : int := Font.New ("Ignacio:16:bold")
assert f10 > 0
var f11 : int := Font.New ("Ignacio:16:bold") % Font Information
assert f11 > 0 % Make Sure Font Is Made
% Click To Let Magic Begin
var f12 : int := Font.New ("Ignacio:14") % Font Information
assert f12 > 0 % Make Sure Font Is Made
% Variable For Select Level (Addition)
var f14 : int := Font.New ("Ignacio:32") % Font Information
assert f14 > 0 % Make Sure Font Is Made
% Back (Addition)
var f15 : int := Font.New ("Ignacio:16")
assert f15 > 0
% Easy (Addition)
var f16 : int := Font.New ("Ignacio:16")
assert f16 > 0
% Normal (Addition)
var f17 : int := Font.New ("Ignacio:16")
assert f17 > 0
% Hard (Addition)
var f18 : int := Font.New ("Ignacio:16")
assert f18 > 0
% Varaiable For buttonwait
var x : int
var y : int
var bnum : int
var bud : int
var a : int
var b : int
var c : int
var answer : int
const NUM_OF_QUESTIONS := 5
var temp : int
var count : int := 0
% Music Variable (Finished)
var finished : boolean := false
var finished2 : boolean := false
% During
var finished3 : boolean := false
% End During
var finished4 : boolean := false
var finished5 : boolean := false
% Flicker Free Transitions
View.Update
%%%%%%%%%%% Music Variables %%%%%%%%%%%%
% Splash Screen
process splash
loop
exit when finished
Music.PlayFile ("Splash.mp3")
end loop
end splash
% Menu Screen
process menu
loop
exit when finished2
Music.PlayFile ("Menu.mp3")
end loop
end menu
% During Gameplay
process Dgame
loop
exit when finished3
Music.PlayFile ("Termina.mp3")
end loop
end Dgame
% Back To Menu
process BTM
loop
exit when finished4
Music.PlayFile ("Menu.mp3")
end loop
end BTM
% Credits Music
process CM
loop
exit when finished5
Music.PlayFile ("Splash.mp3")
end loop
end CM
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SPLASH SCREEN %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Stars
for s1 : 1 .. 15
randint (q, 0, 700)
randint (w, 620, 750)
loop
drawfillstar (q, w, q + 10, w + 10, yellow)
delay (100)
drawfillstar (q, w, q + 10, w + 10, white)
exit when hasch
end loop
end for
% Buttonwait & Loop
buttonwait ("down", x, y, bnum, bud)
% Ending the Music
% Stops the background music.
finished2 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Addition %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if x > 85 and x < 223 and y > 275 and y < 375 then
if x > 305 and x < 440 and y > 275 and y < 375 then % Easy
colorback (53)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 9)
randint (b, 0, 9)
Font.Draw (intstr (a) + " + " + intstr (b) + " = ", 285, 565, f14, black)
get answer
Font.Draw (intstr (a) + " + " + intstr (b) + " = " + intstr (answer), 285, 565, f14, black)
if answer = a + b then
Font.Draw ("Correct!", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a + b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a + b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 170 and y < 270 then % Normal
colorback (68)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 30)
randint (b, 0, 30)
Font.Draw (intstr (a) + " + " + intstr (b) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a) + " + " + intstr (b) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a + b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a + b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a + b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 65 and y < 165 then % Hard
colorback (40)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, -10, 30)
randint (b, -10, 30)
Font.Draw (intstr (a) + " + " + intstr (b) + " = ", 90, 565, f14, black)
get answer
if answer = a + b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a + b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a + b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
else
fork BTM
exit
end if
delay (500)
% Ending the Music
% Stops the background music.
finished4 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Addition End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Subtraction %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elsif x > 235 and x < 373 and y > 275 and y < 375 then
if x > 305 and x < 440 and y > 275 and y < 375 then % Easy
colorback (53)
for o : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 9)
randint (b, 0, 9)
if b > a then
temp := b
b := a
a := temp
end if
Font.Draw (intstr (a) + " - " + intstr (b) + " = ", 285, 565, f14, black)
get answer
Font.Draw (intstr (a) + " - " + intstr (b) + " = " + intstr (answer), 285, 565, f14, black)
if answer = a - b then
Font.Draw ("Correct!", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a - b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a - b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 170 and y < 270 then % Normal
colorback (68)
for o : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 30)
randint (b, 0, 30)
if b > a then
temp := b
b := a
a := temp
end if
Font.Draw (intstr (a) + " - " + intstr (b) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a) + " - " + intstr (b) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a - b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a - b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a - b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 65 and y < 165 then % Hard
colorback (40)
for o : 1 .. NUM_OF_QUESTIONS
cls
randint (a, -10, 20)
randint (b, -10, 20)
Font.Draw (intstr (a) + " - " + intstr (b) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a) + " - " + intstr (b) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a - b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a - b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a - b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
else
fork BTM
exit
end if
delay (500)
% Ending the Music
% Stops the background music.
finished4 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Subtract End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Multplication %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elsif x > 385 and x < 520 and y > 275 and y < 375 then
if answer = a * b then
Font.Draw ("Correct!", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 170 and y < 270 then % Normal
colorback (68)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 10)
randint (b, 0, 10)
Font.Draw (intstr (a) + " * " + intstr (b) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a) + " * " + intstr (b) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a * b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 65 and y < 165 then % Hard
colorback (40)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, -5, 10)
randint (b, -5, 10)
Font.Draw (intstr (a) + " * " + intstr (b) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a) + " * " + intstr (b) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a * b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
else
fork BTM
exit
end if
delay (500)
% Ending the Music
% Stops the background music.
finished4 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Multiply End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Divide %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elsif x > 530 and x < 665 and y > 275 and y < 375 then
loop
fork Dgame
% Horizon Above (Sky)
drawfillbox (0, 300, 200, 600, 53)
drawfillbox (200, 300, 500, 600, 53)
drawfillbox (500, 300, 750, 600, 53)
drawfillbox (0, 600, 750, 750, 53)
if x > 305 and x < 440 and y > 275 and y < 375 then % Easy
colorback (53)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 1, 8)
randint (b, 1, 8)
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = ", 285, 565, f14, black)
get answer
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = " + intstr (answer), 285, 565, f14, black)
if answer = a * b div a then
Font.Draw ("Correct!", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b div a), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b div a then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 170 and y < 270 then % Normal
colorback (68)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 1, 10)
randint (b, 1, 10)
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a * b div a then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b div a), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b div a then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 65 and y < 165 then % Hard
colorback (40)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, -5, 10)
randint (b, -5, 10)
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a * b div a then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Right Answer Is " + intstr (a * b div a), 80, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b div a then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
% Ending the Music
% Stops the background music.
finished3 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
else
fork BTM
exit
end if
delay (500)
% Ending the Music
% Stops the background music.
finished4 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Divide End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Exit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elsif x > 310 and x < 445 and y > 165 and y < 265 then
fork CM
cls
delay (500)
drawfillbox (0, 0, 750, 750, white)
delay (3000)
for yy : 0 .. maxy by 100
Font.Draw ("Magic Math", 200, yy, f9, 43)
delay (2000)
cls
end for
for yyy : 0 .. maxy by 100
Font.Draw ("Done By: Jawad Khan", 280, yyy, f10, 43)
delay (2000)
cls
end for
for yyyy : 0 .. maxy by 100
Font.Draw ("Infor-Games, In Cooperation With", 200, yyyy, f11, 43)
delay (2000)
cls
end for
for yyyyy : 0 .. maxy by 100
Pic.ScreenLoad ("EA2.jpg", 230, yyyyy, picCopy)
delay (1500)
cls
end for
delay (500)
Font.Draw ("Magic Math", 200, 500, f9, 43)
cls
% Ending the Music
% Stops the background music.
finished5 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
exit
end if
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Exit End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5%%%%%%%%%%%%%%%%%%%%%
You'll also need these music files...
solblade05
Posted: Fri Jan 06, 2006 12:04 am Post subject: (No subject)
OK This is what i have so far...
code:
setscreen ("graphics:750;750, nocursor, noecho")
%Stars
var q : int
var w : int
% Done By
var f2 : int := Font.New ("Ignacio:22:bold") % Font Information
assert f2 > 0 % Make Sure Font Is Made
% Adding
var f4 : int := Font.New ("Ignacio:16") % Font Information
assert f4 > 0 % Make Sure Font Is Made
% Menu
var f3 : int := Font.New ("Ignacio:44") % Font Information
assert f3 > 0 % Make Sure Font Is Made
% Subtract
var f5 : int := Font.New ("Ignacio:16") % Font Information
assert f5 > 0 % Make Sure Font Is Made
% Multiply
var f6 : int := Font.New ("Ignacio:16") % Font Information
assert f6 > 0 % Make Sure Font Is Made
% Divide
var f7 : int := Font.New ("Ignacio:16") % Font Information
assert f7 > 0 % Make Sure Font Is Made
% Exit
var f8 : int := Font.New ("Ignacio:16") % Font Information
assert f8 > 0 % Make Sure Font Is Made
% Credits
var f9 : int := Font.New ("Ignacio:50:bold") % Font Information
assert f9 > 0 % Make Sure Font Is Made
var f10 : int := Font.New ("Ignacio:16:bold")
assert f10 > 0
var f11 : int := Font.New ("Ignacio:16:bold") % Font Information
assert f11 > 0 % Make Sure Font Is Made
% Click To Let Magic Begin
var f12 : int := Font.New ("Ignacio:14") % Font Information
assert f12 > 0 % Make Sure Font Is Made
% Variable For Select Level (Addition)
var f14 : int := Font.New ("Ignacio:32") % Font Information
assert f14 > 0 % Make Sure Font Is Made
% Back (Addition)
var f15 : int := Font.New ("Ignacio:16")
assert f15 > 0
% Easy (Addition)
var f16 : int := Font.New ("Ignacio:16")
assert f16 > 0
% Normal (Addition)
var f17 : int := Font.New ("Ignacio:16")
assert f17 > 0
% Hard (Addition)
var f18 : int := Font.New ("Ignacio:16")
assert f18 > 0
% Varaiable For buttonwait
var x : int
var y : int
var bnum : int
var bud : int
var a : int
var b : int
var c : int
var answer : int
const NUM_OF_QUESTIONS := 5
var temp : int
var count : int := 0
% Music Variable (Finished)
var finished : boolean := false
var finished2 : boolean := false
% During
var finished3 : boolean := false
% End During
var finished4 : boolean := false
var finished5 : boolean := false
% Flicker Free Transitions
View.Update
%%%%%%%%%%% Music Variables %%%%%%%%%%%%
% Splash Screen
process splash
loop
exit when finished
Music.PlayFile ("Splash.mp3")
end loop
end splash
% Menu Screen
process menu
loop
exit when finished2
Music.PlayFile ("Menu.mp3")
end loop
end menu
% During Gameplay
process Dgame
loop
exit when finished3
Music.PlayFile ("Termina.mp3")
end loop
end Dgame
% Back To Menu
process BTM
loop
exit when finished4
Music.PlayFile ("Menu.mp3")
end loop
end BTM
% Credits Music
process CM
loop
exit when finished5
Music.PlayFile ("Splash.mp3")
end loop
end CM
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SPLASH SCREEN %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Stars
for s1 : 1 .. 15
randint (q, 0, 700)
randint (w, 620, 750)
loop
drawfillstar (q, w, q + 10, w + 10, yellow)
delay (100)
drawfillstar (q, w, q + 10, w + 10, white)
exit when hasch
end loop
end for
% Buttonwait & Loop
buttonwait ("down", x, y, bnum, bud)
% Ending the Music
% Stops the background music.
finished2 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Addition %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if x > 85 and x < 223 and y > 275 and y < 375 then
if x > 305 and x < 440 and y > 275 and y < 375 then % Easy
colorback (53)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 9)
randint (b, 0, 9)
Font.Draw (intstr (a) + " + " + intstr (b) + " = ", 285, 565, f14, black)
get answer
Font.Draw (intstr (a) + " + " + intstr (b) + " = " + intstr (answer), 285, 565, f14, black)
if answer = a + b then
Font.Draw ("Correct!", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a + b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a + b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 170 and y < 270 then % Normal
colorback (68)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 30)
randint (b, 0, 30)
Font.Draw (intstr (a) + " + " + intstr (b) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a) + " + " + intstr (b) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a + b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a + b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a + b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 65 and y < 165 then % Hard
colorback (40)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, -10, 30)
randint (b, -10, 30)
Font.Draw (intstr (a) + " + " + intstr (b) + " = ", 90, 565, f14, black)
get answer
if answer = a + b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a + b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a + b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
else
fork BTM
exit
end if
delay (500)
% Ending the Music
% Stops the background music.
finished4 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Addition End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Subtraction %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elsif x > 235 and x < 373 and y > 275 and y < 375 then
if x > 305 and x < 440 and y > 275 and y < 375 then % Easy
colorback (53)
for o : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 9)
randint (b, 0, 9)
if b > a then
temp := b
b := a
a := temp
end if
Font.Draw (intstr (a) + " - " + intstr (b) + " = ", 285, 565, f14, black)
get answer
Font.Draw (intstr (a) + " - " + intstr (b) + " = " + intstr (answer), 285, 565, f14, black)
if answer = a - b then
Font.Draw ("Correct!", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a - b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a - b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 170 and y < 270 then % Normal
colorback (68)
for o : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 30)
randint (b, 0, 30)
if b > a then
temp := b
b := a
a := temp
end if
Font.Draw (intstr (a) + " - " + intstr (b) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a) + " - " + intstr (b) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a - b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a - b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a - b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 65 and y < 165 then % Hard
colorback (40)
for o : 1 .. NUM_OF_QUESTIONS
cls
randint (a, -10, 20)
randint (b, -10, 20)
Font.Draw (intstr (a) + " - " + intstr (b) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a) + " - " + intstr (b) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a - b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a - b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a - b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
else
fork BTM
exit
end if
delay (500)
% Ending the Music
% Stops the background music.
finished4 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Subtract End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Multplication %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elsif x > 385 and x < 520 and y > 275 and y < 375 then
if answer = a * b then
Font.Draw ("Correct!", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 170 and y < 270 then % Normal
colorback (68)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 10)
randint (b, 0, 10)
Font.Draw (intstr (a) + " * " + intstr (b) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a) + " * " + intstr (b) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a * b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 65 and y < 165 then % Hard
colorback (40)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, -5, 10)
randint (b, -5, 10)
Font.Draw (intstr (a) + " * " + intstr (b) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a) + " * " + intstr (b) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a * b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
else
fork BTM
exit
end if
delay (500)
% Ending the Music
% Stops the background music.
finished4 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Multiply End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Divide %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elsif x > 530 and x < 665 and y > 275 and y < 375 then
loop
fork Dgame
% Horizon Above (Sky)
drawfillbox (0, 300, 200, 600, 53)
drawfillbox (200, 300, 500, 600, 53)
drawfillbox (500, 300, 750, 600, 53)
drawfillbox (0, 600, 750, 750, 53)
if x > 305 and x < 440 and y > 275 and y < 375 then % Easy
colorback (53)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 1, 8)
randint (b, 1, 8)
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = ", 285, 565, f14, black)
get answer
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = " + intstr (answer), 285, 565, f14, black)
if answer = a * b div a then
Font.Draw ("Correct!", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b div a), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b div a then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 170 and y < 270 then % Normal
colorback (68)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 1, 10)
randint (b, 1, 10)
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a * b div a then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b div a), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b div a then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 65 and y < 165 then % Hard
colorback (40)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, -5, 10)
randint (b, -5, 10)
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a * b div a then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Right Answer Is " + intstr (a * b div a), 80, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b div a then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
% Ending the Music
% Stops the background music.
finished3 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
else
fork BTM
exit
end if
delay (500)
% Ending the Music
% Stops the background music.
finished4 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Divide End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Exit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elsif x > 310 and x < 445 and y > 165 and y < 265 then
fork CM
cls
delay (500)
drawfillbox (0, 0, 750, 750, white)
delay (3000)
for yy : 0 .. maxy by 100
Font.Draw ("Magic Math", 200, yy, f9, 43)
delay (2000)
cls
end for
for yyy : 0 .. maxy by 100
Font.Draw ("Done By: Jawad Khan", 280, yyy, f10, 43)
delay (2000)
cls
end for
for yyyy : 0 .. maxy by 100
Font.Draw ("Infor-Games, In Cooperation With", 200, yyyy, f11, 43)
delay (2000)
cls
end for
for yyyyy : 0 .. maxy by 100
Pic.ScreenLoad ("EA2.jpg", 230, yyyyy, picCopy)
delay (1500)
cls
end for
delay (500)
Font.Draw ("Magic Math", 200, 500, f9, 43)
cls
% Ending the Music
% Stops the background music.
finished5 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
exit
end if
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Exit End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5%%%%%%%%%%%%%%%%%%%%%
You'll also need these music files...
solblade05
Posted: Fri Jan 06, 2006 12:07 am Post subject: (No subject)
OK This is what i have so far...
code:
setscreen ("graphics:750;750, nocursor, noecho")
%Stars
var q : int
var w : int
% Done By
var f2 : int := Font.New ("Ignacio:22:bold") % Font Information
assert f2 > 0 % Make Sure Font Is Made
% Adding
var f4 : int := Font.New ("Ignacio:16") % Font Information
assert f4 > 0 % Make Sure Font Is Made
% Menu
var f3 : int := Font.New ("Ignacio:44") % Font Information
assert f3 > 0 % Make Sure Font Is Made
% Subtract
var f5 : int := Font.New ("Ignacio:16") % Font Information
assert f5 > 0 % Make Sure Font Is Made
% Multiply
var f6 : int := Font.New ("Ignacio:16") % Font Information
assert f6 > 0 % Make Sure Font Is Made
% Divide
var f7 : int := Font.New ("Ignacio:16") % Font Information
assert f7 > 0 % Make Sure Font Is Made
% Exit
var f8 : int := Font.New ("Ignacio:16") % Font Information
assert f8 > 0 % Make Sure Font Is Made
% Credits
var f9 : int := Font.New ("Ignacio:50:bold") % Font Information
assert f9 > 0 % Make Sure Font Is Made
var f10 : int := Font.New ("Ignacio:16:bold")
assert f10 > 0
var f11 : int := Font.New ("Ignacio:16:bold") % Font Information
assert f11 > 0 % Make Sure Font Is Made
% Click To Let Magic Begin
var f12 : int := Font.New ("Ignacio:14") % Font Information
assert f12 > 0 % Make Sure Font Is Made
% Variable For Select Level (Addition)
var f14 : int := Font.New ("Ignacio:32") % Font Information
assert f14 > 0 % Make Sure Font Is Made
% Back (Addition)
var f15 : int := Font.New ("Ignacio:16")
assert f15 > 0
% Easy (Addition)
var f16 : int := Font.New ("Ignacio:16")
assert f16 > 0
% Normal (Addition)
var f17 : int := Font.New ("Ignacio:16")
assert f17 > 0
% Hard (Addition)
var f18 : int := Font.New ("Ignacio:16")
assert f18 > 0
% Varaiable For buttonwait
var x : int
var y : int
var bnum : int
var bud : int
var a : int
var b : int
var c : int
var answer : int
const NUM_OF_QUESTIONS := 5
var temp : int
var count : int := 0
% Music Variable (Finished)
var finished : boolean := false
var finished2 : boolean := false
% During
var finished3 : boolean := false
% End During
var finished4 : boolean := false
var finished5 : boolean := false
% Flicker Free Transitions
View.Update
%%%%%%%%%%% Music Variables %%%%%%%%%%%%
% Splash Screen
process splash
loop
exit when finished
Music.PlayFile ("Splash.mp3")
end loop
end splash
% Menu Screen
process menu
loop
exit when finished2
Music.PlayFile ("Menu.mp3")
end loop
end menu
% During Gameplay
process Dgame
loop
exit when finished3
Music.PlayFile ("Termina.mp3")
end loop
end Dgame
% Back To Menu
process BTM
loop
exit when finished4
Music.PlayFile ("Menu.mp3")
end loop
end BTM
% Credits Music
process CM
loop
exit when finished5
Music.PlayFile ("Splash.mp3")
end loop
end CM
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SPLASH SCREEN %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Stars
for s1 : 1 .. 15
randint (q, 0, 700)
randint (w, 620, 750)
loop
drawfillstar (q, w, q + 10, w + 10, yellow)
delay (100)
drawfillstar (q, w, q + 10, w + 10, white)
exit when hasch
end loop
end for
% Buttonwait & Loop
buttonwait ("down", x, y, bnum, bud)
% Ending the Music
% Stops the background music.
finished2 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Addition %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if x > 85 and x < 223 and y > 275 and y < 375 then
if x > 305 and x < 440 and y > 275 and y < 375 then % Easy
colorback (53)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 9)
randint (b, 0, 9)
Font.Draw (intstr (a) + " + " + intstr (b) + " = ", 285, 565, f14, black)
get answer
Font.Draw (intstr (a) + " + " + intstr (b) + " = " + intstr (answer), 285, 565, f14, black)
if answer = a + b then
Font.Draw ("Correct!", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a + b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a + b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 170 and y < 270 then % Normal
colorback (68)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 30)
randint (b, 0, 30)
Font.Draw (intstr (a) + " + " + intstr (b) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a) + " + " + intstr (b) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a + b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a + b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a + b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 65 and y < 165 then % Hard
colorback (40)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, -10, 30)
randint (b, -10, 30)
Font.Draw (intstr (a) + " + " + intstr (b) + " = ", 90, 565, f14, black)
get answer
if answer = a + b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a + b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a + b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
else
fork BTM
exit
end if
delay (500)
% Ending the Music
% Stops the background music.
finished4 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Addition End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Subtraction %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elsif x > 235 and x < 373 and y > 275 and y < 375 then
if x > 305 and x < 440 and y > 275 and y < 375 then % Easy
colorback (53)
for o : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 9)
randint (b, 0, 9)
if b > a then
temp := b
b := a
a := temp
end if
Font.Draw (intstr (a) + " - " + intstr (b) + " = ", 285, 565, f14, black)
get answer
Font.Draw (intstr (a) + " - " + intstr (b) + " = " + intstr (answer), 285, 565, f14, black)
if answer = a - b then
Font.Draw ("Correct!", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a - b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a - b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 170 and y < 270 then % Normal
colorback (68)
for o : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 30)
randint (b, 0, 30)
if b > a then
temp := b
b := a
a := temp
end if
Font.Draw (intstr (a) + " - " + intstr (b) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a) + " - " + intstr (b) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a - b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a - b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a - b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 65 and y < 165 then % Hard
colorback (40)
for o : 1 .. NUM_OF_QUESTIONS
cls
randint (a, -10, 20)
randint (b, -10, 20)
Font.Draw (intstr (a) + " - " + intstr (b) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a) + " - " + intstr (b) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a - b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a - b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a - b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
else
fork BTM
exit
end if
delay (500)
% Ending the Music
% Stops the background music.
finished4 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Subtract End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Multplication %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elsif x > 385 and x < 520 and y > 275 and y < 375 then
if answer = a * b then
Font.Draw ("Correct!", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 170 and y < 270 then % Normal
colorback (68)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 10)
randint (b, 0, 10)
Font.Draw (intstr (a) + " * " + intstr (b) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a) + " * " + intstr (b) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a * b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 65 and y < 165 then % Hard
colorback (40)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, -5, 10)
randint (b, -5, 10)
Font.Draw (intstr (a) + " * " + intstr (b) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a) + " * " + intstr (b) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a * b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
else
fork BTM
exit
end if
delay (500)
% Ending the Music
% Stops the background music.
finished4 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Multiply End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Divide %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elsif x > 530 and x < 665 and y > 275 and y < 375 then
loop
fork Dgame
% Horizon Above (Sky)
drawfillbox (0, 300, 200, 600, 53)
drawfillbox (200, 300, 500, 600, 53)
drawfillbox (500, 300, 750, 600, 53)
drawfillbox (0, 600, 750, 750, 53)
if x > 305 and x < 440 and y > 275 and y < 375 then % Easy
colorback (53)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 1, 8)
randint (b, 1, 8)
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = ", 285, 565, f14, black)
get answer
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = " + intstr (answer), 285, 565, f14, black)
if answer = a * b div a then
Font.Draw ("Correct!", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b div a), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b div a then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 170 and y < 270 then % Normal
colorback (68)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 1, 10)
randint (b, 1, 10)
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a * b div a then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b div a), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b div a then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 65 and y < 165 then % Hard
colorback (40)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, -5, 10)
randint (b, -5, 10)
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a * b div a then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Right Answer Is " + intstr (a * b div a), 80, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b div a then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
% Ending the Music
% Stops the background music.
finished3 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
else
fork BTM
exit
end if
delay (500)
% Ending the Music
% Stops the background music.
finished4 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Divide End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Exit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elsif x > 310 and x < 445 and y > 165 and y < 265 then
fork CM
cls
delay (500)
drawfillbox (0, 0, 750, 750, white)
delay (3000)
for yy : 0 .. maxy by 100
Font.Draw ("Magic Math", 200, yy, f9, 43)
delay (2000)
cls
end for
for yyy : 0 .. maxy by 100
Font.Draw ("Done By: Jawad Khan", 280, yyy, f10, 43)
delay (2000)
cls
end for
for yyyy : 0 .. maxy by 100
Font.Draw ("Infor-Games, In Cooperation With", 200, yyyy, f11, 43)
delay (2000)
cls
end for
for yyyyy : 0 .. maxy by 100
Pic.ScreenLoad ("EA2.jpg", 230, yyyyy, picCopy)
delay (1500)
cls
end for
delay (500)
Font.Draw ("Magic Math", 200, 500, f9, 43)
cls
% Ending the Music
% Stops the background music.
finished5 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
exit
end if
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Exit End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5%%%%%%%%%%%%%%%%%%%%%
You'll also need these music files...
[Gandalf]
Posted: Fri Jan 06, 2006 12:35 am Post subject: (No subject)
Sweet, we all love scrolling down pages of code, but for the few that don't next time attach anything nearly as long as that so we can actually see what the post is about.