home *** CD-ROM | disk | FTP | other *** search
Wrap
GW-BASIC | 1991-12-02 | 3.9 KB | 86 lines
10 '========================================================== 20 '** ADDING DECIMALS ** 30 '** By STAN GREENE - 03/05/85 ** 40 '** INSTR/BAS ** 50 '** Copyright 1984 - MICROCOMPUTER WORKSHOPS ** 60 '========================================================== 70 DEFSTR A-B,F-I:DEFINT C,E,L,N-P,W-Z 80 X= VAL(MID$(TIME$,7,2)): RANDOMIZE X 90 COMMON GN,CJ,CBS,JC 100 IF CBS < 32 THEN CHAIN "CBS.BAS" 110 DEF FNROW(X23)=INT((X23/64+1)): DEF FNCOL(X23)=INT((X23-(INT(X23/64)*64))+1) 120 F1="Press <ENTER> to continue.":DEF FNF1="Sorry, "+GN+". "+I+" is not correct.":GOTO 190 130 GOSUB 850 140 I=INKEY$:IF I= "" OR I= "%" OR I= CHR$(13) THEN 140 ELSE LOCATE ,,0:RETURN 150 GOSUB 850:LOCATE 23,5:PRINT "Press ";:COLOR CJ,7:PRINT"space bar";:COLOR 7,CJ:PRINT " to continue."; 160 I=INKEY$:IF I <> CHR$(32) THEN 160 ELSE RETURN 170 '***** INKEY$ ROUTINE FOR ADDITION ANSWERS 180 '***** BEGIN A PROBLEM 190 CLS:LOCATE 2,14:PRINT "INSTRUCTIONS" 200 LOCATE 8,1: PRINT GN;","; 210 LOCATE 11,1:PRINT "After you read these instructions, be":PRINT:PRINT"sure you practice the line-up stage.":GOSUB 150 220 FOR SG=1 TO 800:NEXT 230 CLS:PRINT TAB(9)"ADDITION INSTRUCTIONS" 240 LOCATE 3,17:PRINT "162"; 250 LOCATE 4,20:PRINT ".84"; 260 LOCATE 5,15:PRINT "+ 4.32"; 270 LOCATE 6,15:PRINT STRING$(9,223); 280 LOCATE 7,20:PRINT ". ";CHR$(219); 290 LOCATE 12,1:PRINT "After you have lined up the numbers, the"; 300 LOCATE 14,1:PRINT "problem will look like the one above.";:GOSUB 150 310 LOCATE 23,5:PRINT STRING$(28,32); 320 LOCATE 12,1:PRINT "Just before you start adding, you can "; 330 LOCATE 14,1:PRINT "put zeroes in the right places by "; 340 LOCATE 16,1:PRINT "pressing Z. 350 LOCATE 20,10:PRINT "Press ";:COLOR CJ,7:PRINT"Z";:COLOR 7,CJ:PRINT", ";GN;"."; 360 GOSUB 850 370 I=INKEY$: IF I="" THEN 370 ELSE IF I <> "Z" THEN 370 380 LOCATE 3,20: PRINT ".00";: GOSUB 830: LOCATE 15,12: PRINT "Very nice, ";GN;"!";:GOSUB 150 390 LOCATE 12,1:PRINT"The white square -- called the cursor --"; 400 LOCATE 14,1:PRINT"shows where you must put the answer."; 410 LOCATE 15,12:PRINT STRING$(25,32); 420 LOCATE 17,1:PRINT"If it appears at the bottom, you must"; 430 LOCATE 19,1:PRINT"add the column.";:GOSUB 150 440 GOSUB 840:LOCATE 12,1:PRINT "Here the sum of the column is 6. You"; 450 LOCATE 14,1:PRINT"must now press 6 to add the column. 460 LOCATE 17,12:PRINT"Press ";:COLOR CJ,7:PRINT"6";:COLOR 7,CJ:PRINT ", ";GN;"."; 470 GOSUB 850 480 I=INKEY$: IF I="" THEN 480 ELSE IF I <> "6" THEN 480 490 LOCATE 2,21:PRINT CHR$(219);:LOCATE 7,22:PRINT"6"; 500 GOSUB 830:LOCATE 17,12:PRINT"Well done, ";GN;"!";:GOSUB 150 510 LOCATE 12,1:PRINT"Notice that the cursor is now on top of"; 520 LOCATE 14,1:PRINT"the next column. Now you must enter the"; 530 LOCATE 16,1:PRINT"carry.";:LOCATE 17,12:PRINT STRING$(25,32);:GOSUB 150 540 GOSUB 840:LOCATE 12,1:PRINT "The carry here is 0. You must now press"; 550 LOCATE 14,1:PRINT"the ";:COLOR CJ,7:PRINT"0";:COLOR 7,CJ:PRINT" key."; 560 LOCATE 17,12:PRINT"Press ";:COLOR CJ,7:PRINT"0";:COLOR 7,CJ:PRINT ", ";GN;"."; 570 GOSUB 850 580 I=INKEY$: IF I="" THEN 580 ELSE IF I <> "0" THEN 580 590 LOCATE 2,21:PRINT"0";:LOCATE 7,21:PRINT CHR$(219); 600 GOSUB 830:LOCATE 12,1:PRINT"Nicely done, ";GN;"!"; 610 LOCATE 14,1:PRINT"Now add the next column.":GOTO 630 620 LOCATE 12,1:PRINT"Now add the column, ";GN;"." 630 GOSUB 850 640 I=INKEY$: IF I="" THEN 640 650 IF I = "1" THEN I="":GOTO 670 660 LOCATE 14,1:PRINT STRING$(25,32);:LOCATE 12,1,0:PRINT "The sum here is 11, ";GN;".";:GOSUB 150:LOCATE 23,5:PRINT STRING$(28,32);:GOTO 620 670 LOCATE 7,21:PRINT "1";:LOCATE 2,19:PRINT CHR$(219);:GOSUB 840 680 LOCATE 12,1:PRINT"Very well done. Now enter the carry!":GOTO 700 690 LOCATE 12,1:PRINT"Now enter the carry, ";GN;"."; 700 GOSUB 850 710 I=INKEY$: IF I="" THEN 710 720 IF I = "1" THEN I="":GOTO 740 730 LOCATE 12,1:PRINT "The carry is 1. ";:GOSUB 150:LOCATE 23,5:PRINT STRING$(28,32);:GOTO 690 740 LOCATE 2,19:PRINT"1";:LOCATE 7,19:PRINT CHR$(219);:LOCATE 12,1:PRINT STRING$(39,32);:LOCATE 12,1:PRINT"Excellent, ";GN;"!";:LOCATE 14,1:PRINT"I think you understand how to do this!":GOSUB 150 750 CLS:LOCATE 3,1:PRINT"After you finish a problem, I will tell";:LOCATE 5,1:PRINT"you what mistakes you made."; 760 LOCATE 10,1:PRINT"After you finish a set of problems, I";:LOCATE 12,1:PRINT"will give you a list of all the errors";:LOCATE 14,1:PRINT"you made.";:GOSUB 150 770 CLS:LOCATE 3,1:PRINT"Don't forget to practice the lining-up";:LOCATE 5,1:PRINT"stage, ";GN;".";:LOCATE 10,1:PRINT"Press a key to return to the menu." 780 I=INKEY$:IF I ="" THEN 780 790 CLS:LOCATE 12,10:PRINT "Please wait, ";GN;"."; 800 CHAIN "add.bas" 820 STOP 830 FOR X=12 TO 20:LOCATE X,1:PRINT STRING$(40,32);:NEXT X:RETURN 840 FOR X=12 TO 20:LOCATE X,1:PRINT STRING$(40,32);:NEXT X:LOCATE 23,5:PRINT STRING$(28,32);:RETURN 850 DEF SEG=0: POKE 1050,PEEK(1052): DEF SEG=64: POKE 23,96: DEF SEG: RETURN 860 DEF SEG: SCREEN 0: CJ=0:COLOR 7,CJ,CJ: CLS: WIDTH 80: RETURN