home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 15
/
CD_ASCQ_15_070894.iso
/
maj
/
2179
/
examples.exe
/
MATHWIZZ.SHW
< prev
next >
Wrap
Text File
|
1994-06-01
|
3KB
|
142 lines
;*********************************************************************;
; Sciptname..: MathWizz.SHW ;
; Revision...: 1.1, Apr. 1994, by RMP DATA. ;
; Purpose....: Promotion for DATASHOW, as an example script. ;
;*********************************************************************;
; Create all global variables
VARIABLE CREATE var1 TYPE NUMBER 0
VARIABLE CREATE var2 TYPE NUMBER 0
VARIABLE CREATE soundit TYPE NUMBER 0
VARIABLE CREATE result TYPE NUMBER 0
VARIABLE CREATE input TYPE NUMBER 0
VARIABLE CREATE inkey TYPE KEY
SHOW SCREEN "mathwiz1.scr" TXT
WAIT 3
VARIABLE CREATE answer TYPE STRING ""
goxy 20 11 draw box 40 2
goxy 21 12 write "Do you wish sounds in this game (Y/N) "
MARK 1
GOXY 59 12 READ STRING UPPER answer 1
CASE STRING answer "Y" DO JUMPMARK 2
CASE STRING answer "N" DO JUMPMARK 2
JUMPMARK 1
MARK 2
CASE STRING answer "Y" DO MATH soundit = 1
VARIABLE RELEASE answer
; Starting point for addition puzzles
MARK 10
SHOW SCREEN "mathwiz2.scr" TXT
math var1 = random(100)
math var2 = random(100)
math result = var1 + var2
goxy 30 10 write var1
goxy 30 11 write "+"
goxy 30 12 write var2
goxy 30 13 write "--------"
goxy 30 15 write "--------"
goxy 30 14 READ STRING input 4
IF input EQ result DO JUMPMARK 11
goxy 30 17 write "Wrong result..."
goxy 30 19 write "The result was: "+result
IF soundit EQ 1 DO
SPEAK "W-R-OH-N-G"
WAIT 1
SPEAK "R-EE-S-UH-L-T"
SPEAK "EE-S"
WAIT 1
SPEAK result
END
JUMPMARK 12
MARK 11
goxy 30 17 write "CONGRATULATION!!!"
IF soundit EQ 1 DO
SPEAK "K-OH-R-EH-K-T"
END
MARK 12
goxy 4 25
write "Q = Quit, PgDn = New Operator, Any other key = Continue this puzzle"
READ KEY inkey
CASE KEY inkey 81 DO JUMPMARK 100 ; 'q'
CASE KEY inkey 113 DO JUMPMARK 100 ; 'Q'
CASE KEY inkey 481 DO JUMPMARK 20 ; 'PgDn'
; Jump back to starting point
JUMPMARK 10
; Starting point for multiplication puzzles
MARK 20
SHOW SCREEN "mathwiz2.scr" TXT
math var1 = random(100)
math var2 = random(100)
math result = var1 * var2
goxy 30 10 write var1
goxy 30 11 write "*"
goxy 30 12 write var2
goxy 30 13 write "--------"
goxy 30 15 write "--------"
goxy 30 14 READ STRING input 4
IF input EQ result DO JUMPMARK 21
goxy 30 17 write "Wrong result..."
goxy 30 19 write "The result was: "+result
IF soundit EQ 1 DO
SPEAK "W-R-OH-N-G"
WAIT 1
SPEAK "R-EE-S-UH-L-T"
SPEAK "EE-S"
WAIT 1
SPEAK result
END
JUMPMARK 22
MARK 21
goxy 30 17 write "CONGRATULATION!!!"
IF soundit EQ 1 DO
SPEAK "K-OH-R-EH-K-T"
END
MARK 22
goxy 4 25
write "Q = Quit, Any other key = Continue this puzzle"
READ KEY inkey
CASE KEY inkey 81 DO JUMPMARK 100 ; 'q'
CASE KEY inkey 113 DO JUMPMARK 100 ; 'Q'
JUMPMARK 20
; End the script
MARK 100
COLOR BACKGROUND 0
SCREEN CLEAR
WRITE "THANK YOU FOR USING MATHWIZARD..."
WAIT 2
QUIT