home *** CD-ROM | disk | FTP | other *** search
- 10 text 0,&
-
-
-
-
-
-
- ******************************************************************************** THIS IS THE MATH QUIZ GAME
- ********************************************************************************
-
-
-
- INPUT ONE OF THE FOLLOWING SYMBOLS FOR THE MATH OPERATION YOU WANT TO TRY:
-
- INPUT "+" FOR ADDITION
- INPUT "-" FOR SUBTRACTION
- INPUT "*" FOR MULTIPLICATION
- INPUT "/" FOR DIVISION
- INPUT "Q" WHEN YOU WANT TO QUIT THIS GAME
-
- TO CHANGE THE TYPE OF MATH OPERATION YOU WANT TO DO, TYPE -1 WHEN THE COMPUTER
- GIVES YOU A NEW PROBLEM.
- &
- 20 var o$,a$=string:10
- 30 var j,k,t,i,a=integer
- 40 var m,n,l,p=real
- 50 dim com string o$(10) a$(1)
- 60 let o$="+-*/Qq"
- 145 print "INPUT MATH OPERATION SYMBOL ";
- 150 input a$
- 155 rem find out the operation number of the math symbol
- 160 gosub 495
- 165 print "INPUT THE LOWER AND UPPER LIMITS OF YOUR NUMBERS (L,U) ";
- 170 input j,k
- 175 print "INPUT THE NUMBER OF INCORRECT ANSWERS YOU ARE ALLOWED ";
- 180 input t
- 185 rem get 2 random numbers for m and n
- 190 gosub 370
- 195 i=0
- 200 on a goto 210,245,285,325
- 205 rem routine for addition
- 210 l=m+n
- 215 print m;" + " ; n ; " = ";
- 220 input p
- 225 if p<0 then 145
- 230 if p=l then 435
- 235 gosub 455
- 240 goto 220
- 245 rem routine for subtraction
- 250 l=m-n
- 255 print m;" - " ; n ; " = ";
- 260 input p
- 265 if p<0 then 145
- 270 if p=l then 435
- 275 gosub 455
- 280 goto 260
- 285 rem routine for multiplication
- 290 l=m*n
- 295 print m;" * " ; n ; " = ";
- 300 input p
- 305 if p<0 then 145
- 310 if p=l then 435
- 315 gosub 455
- 320 goto 300
- 325 rem routine for division
- 330 l=m/n
- 335 print m;" / " ; n ; " = ";
- 340 input p
- 345 if p<0 then 145
- 350 if p=l then 435
- 355 gosub 455
- 360 goto 300
- 370 rem subroutine--finds 2 random numbers within the limits of j & k
- 375 m=int(rnd(rnd(1)*10)*k+1)
- 380 if m<j then 375
- 385 n=int(rnd(1)*k+1)
- 390 if n<j then 385
- 395 if a=1 then 425
- 400 if a=3 then 425
- 405 if m<=n then 375
- 415 if int(m/n)*n=(m/n)*n then 425
- 420 goto 375
- 425 return
- 435 rem subroutine--prints if response is correct
- 440 print "YOU ARE RIGHT!"
- 445 goto 190
- 455 rem subroutine--prints if response is wrong
- 460 i=i+1
- 465 if i>=t then 480
- 470 print "SORRY, YOUR ANSWER IS WRONG...PLEASE TRY AGAIN ";
- 475 return
- 480 print "THAT IS " ; i ; " TRIES"
- 485 print "THE CORRECT ANSWER IS ";l
- 490 goto 190
- 495 rem subroutine--gets the operation number from a$
- 505 a=1
- 510 if a$=mid$(o$,a,1) then 530
- 511 a=a+1
- 515 if a>6 then 520 else 510
- 520 print "TYPE +,-,*,/ OR Q"
- 525 goto 145
- 530 if a=5 then 540
- 531 if a=6 then 540
- 535 return
- 540 end