'=========================================================================== ' Subject: PRACTISING SIMPLE ARITHMETIC Date: 12-05-97 (11:36) ' Author: Hensley Bass Code: QB, QBasic, PDS ' Origin: hbass@intnet.mu Packet: ALGOR.ABC '=========================================================================== 'ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ' ' ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ' ' ³ °±² SIMPLE OPERATIONS v1.0 ²±° ³ ' ' ÆÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͵ ' ' ³ Helps you at practising simple mathematical ³ ' ' ³ operations. Copyright (c) November 1995 ³ ' ' ³ ³ ' ' ³ Author: Hensley Bass ³ ' ' ³ Email: hbass@intnet.mu ³ ' ' ³ Home Page: http//pages.intnet.mu/jhbpage ³ ' ³ ' ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ' 'ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ' 'Note:- ' ' Runs under Qbasic, Quickbasic, vbdos and maybe other compatible ' ' environments. If you are using Quick basic type QB /L QB smpl_op.bas ' ' For VbDOS users type VBDOS /L VBDOS smpl_op.bas ' ' ' 'ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ' DECLARE SUB found (whatfound$, z!, x%) DECLARE SUB test () DECLARE SUB textbutton (x!, y!, xinc!, yinc!, gbbg!, bs!, ds!, typ$, tk!) DECLARE SUB backdisplay (k!, L!, kinc!, linc!, fkol!, bkol!, bd$) DECLARE SUB conditionaltiming (duration!) DECLARE SUB addition (misc!, endofsession$, level%, good!, total!) DECLARE SUB division (misc!, endofsession$, level%, good!, total!) DECLARE SUB testlevel (level!) DECLARE SUB Testmenu () DECLARE SUB testmenuscroll () DECLARE SUB miscellaneous (level%, good!, total!) DECLARE SUB multiplication (misc!, endofsession$, level%, good!, total!) DECLARE SUB subtraction (misc!, endofsession$, level%, good!, total!) DECLARE SUB mouse (cx%, dx%, bx%) DECLARE SUB MousePointer (SW%) RANDOMIZE TIMER DEFINT A-Z '============================== DIM SHARED a(9) 'Set up array for code DEF SEG = VARSEG(a(0)) 'Get array segment (nnnn ) ' (two 8 bit) FOR i = 0 TO 17 'length of DATA to READ r 'read POKE VARPTR(a(0)) + i, r 'into array/2 (nnnniiii) (one 8 bit) NEXT i 'until 17 '**************************** Machine Code ********************************* DATA &HB8,&H00,&H00 DATA &H55 DATA &H8B,&HEC DATA &HCD,&H33 DATA &H92 DATA &H8B,&H5E,&H06 DATA &H89,&H07 DATA &H5D DATA &HCA,&H02,&H00 '**************************** ************ ********************************* CONST false = 0 CONST true = NOT false CALL MousePointer(0) 'Reset mouse and CALL MousePointer(1) 'turn pointer on CALL MousePointer(3) 'Get coordinates '======================================== CALL test COLOR 7, 0 CLS DEFSNG A-Z SUB addition (misc, endofsession$, level%, good, total) 'ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Setting all values to zero DO COLOR 7, 3 IF total > 0 THEN LOCATE 21, 26 PRINT USING "###.##"; (good / total) * 100; PRINT " %" END IF numofdigits = 0 'ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ clearing the working board CALL textbutton(9, 43, 8, 28, 0, 0, 0, "³", 0) 'ÍÍÍÍÍÍÍÍÍÍÍÍ COLOR 7, 3 LOCATE 7, 50 PRINT " ADDITION " COLOR , 0 number1 = INT(RND * (100 * level%)) number2 = INT(RND * (100 * level%)) LOCATE 11, 59 - LEN(STR$(number1)) PRINT STR$(number1) + " +" LOCATE 12, 59 - LEN(STR$(number2)) PRINT STR$(number2) answer = number1 + number2 LOCATE 13, 59 - LEN(STR$(answer)) PRINT STRING$(LEN(STR$(answer)), "Ä") DO COLOR 23 LOCATE 14, 58 - numofdigits PRINT "_" COLOR 7 LOCATE 14, 58 - numofdigits - 1 PRINT " " waitforanswer$ = INKEY$ SELECT CASE waitforanswer$ CASE CHR$(27) CALL textbutton(9, 43, 8, 28, 0, 0, 0, "³", 0) endofsession$ = CHR$(27) EXIT DO CASE CHR$(8) IF 58 - numofdigits + 1 <= 58 THEN LOCATE 14, 58 - numofdigits + 1 PRINT " " numofdigits = numofdigits - 1 END IF CASE CHR$(48) TO CHR$(57) IF numofdigits + 1 < LEN(STR$(answer)) THEN LOCATE 14, 58 - numofdigits PRINT waitforanswer$ numofdigits = numofdigits + 1 END IF CASE CHR$(13) total = total + 1 LOCATE 14, 58 - numofdigits PRINT " " answerfound$ = "" FOR x% = 44 TO 58 answerfound$ = answerfound$ + CHR$(SCREEN(14, x%)) NEXT answerfound$ = LTRIM$(RTRIM$(answerfound$)) IF answerfound$ = LTRIM$(RTRIM$(STR$(answer))) THEN good = good + 1 LOCATE 16, 44 PRINT "Good answer!" COLOR 23 LOCATE 17, 44 PRINT "Please wait .." conditionaltiming 2 IF misc = 1 THEN EXIT SUB END IF EXIT DO ELSE LOCATE 16, 44 PRINT "Correct answer is " + LTRIM$(RTRIM$(STR$(answer))) LOCATE 17, 44 PRINT "Press the (SPACE BAR) " DO LOOP UNTIL INKEY$ = CHR$(32) IF misc = 1 THEN EXIT SUB END IF EXIT DO END IF END SELECT LOOP LOOP UNTIL waitforanswer$ = CHR$(27) END SUB SUB backdisplay (k, L, kinc, linc, fkol, bkol, bd$) COLOR fkol, bkol FOR x = k TO k + kinc LOCATE x, L PRINT STRING$(linc, bd$); NEXT END SUB SUB conditionaltiming (duration) DEFINT C, L, R TIM = TIMER DO mouse cx%, dx%, bx% LOOP WHILE (TIMER < TIM + duration) AND bx% <> 1 END SUB DEFSNG C, L, R SUB division (misc, endofsession$, level%, good, total) 'ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Setting all values to zero DO COLOR 7, 3 IF total > 0 THEN LOCATE 21, 26 PRINT USING "###.##"; (good / total) * 100; PRINT " %" END IF numofdigits = 0 'ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ clearing the working board CALL textbutton(9, 43, 8, 28, 0, 0, 0, "³", 0) 'ÍÍÍÍÍÍÍÍÍÍÍÍ COLOR 23 LOCATE 17, 50 PRINT "Please wait ..." COLOR 7, 3 LOCATE 7, 50 PRINT " DIVISION " COLOR 7, 0 restart: number1 = INT(RND * (90 * level%)) + (1 * level%) FOR x = 2 TO number1 z = INT(RND * number1) + 2 IF number1 MOD z = 0 THEN number2 = z EXIT FOR END IF NEXT IF number2 = 0 THEN GOTO restart END IF answer = number1 / number2 IF answer = number1 OR answer = number2 OR answer = 1 OR number1 MOD z <> 0 THEN GOTO restart END IF LOCATE 11, 59 - LEN(STR$(number1)) PRINT STR$(number1) + " ö" LOCATE 12, 59 - LEN(STR$(number2)) PRINT STR$(number2) LOCATE 13, 59 - LEN(STR$(number1)) PRINT STRING$(LEN(STR$(number1)), "Ä") LOCATE 17, 50 PRINT " " DO COLOR 23 LOCATE 14, 58 - LEN(LTRIM$(RTRIM$(STR$(answer)))) + numofdigits + 1 PRINT "_" COLOR 7 waitforanswer$ = INKEY$ SELECT CASE waitforanswer$ CASE CHR$(27) CALL textbutton(9, 43, 8, 28, 0, 0, 0, "³", 0) endofsession$ = CHR$(27) EXIT DO CASE CHR$(8) IF 58 - LEN(STR$(answer)) + numofdigits > 58 - LEN(STR$(answer)) THEN LOCATE 14, 58 - LEN(LTRIM$(RTRIM$(STR$(answer)))) + numofdigits + 1 PRINT " " LOCATE 14, 58 - LEN(STR$(answer)) + numofdigits + 1 PRINT " " numofdigits = numofdigits - 1 END IF CASE CHR$(48) TO CHR$(57) IF numofdigits + 1 < LEN(STR$(answer)) THEN LOCATE 14, 58 - LEN(LTRIM$(RTRIM$(STR$(answer)))) + numofdigits + 1 PRINT waitforanswer$ numofdigits = numofdigits + 1 END IF CASE CHR$(13) total = total + 1 LOCATE 14, 58 - LEN(LTRIM$(RTRIM$(STR$(answer)))) + numofdigits + 1 PRINT " " answerfound$ = "" FOR x% = 44 TO 58 answerfound$ = answerfound$ + CHR$(SCREEN(14, x%)) NEXT answerfound$ = LTRIM$(RTRIM$(answerfound$)) IF answerfound$ = LTRIM$(RTRIM$(STR$(answer))) THEN good = good + 1 LOCATE 17, 44 PRINT "Good answer!" conditionaltiming 2 IF misc = 1 THEN EXIT SUB END IF EXIT DO ELSE LOCATE 16, 44 PRINT "Correct answer is " + LTRIM$(RTRIM$(STR$(answer))) LOCATE 17, 44 PRINT "Press the (SPACE BAR) " DO LOOP UNTIL INKEY$ = CHR$(32) IF misc = 1 THEN EXIT SUB END IF EXIT DO END IF END SELECT LOOP LOOP UNTIL waitforanswer$ = CHR$(27) END SUB DEFINT C, L, R SUB found (whatfound$, z, x%) COLOR 7, 4 whatfound$ = "" FOR x% = 15 TO 30 whatfound$ = whatfound$ + CHR$(SCREEN(z, x%)) NEXT whatfound$ = RTRIM$(whatfound$) + SPACE$(15 - LEN(LTRIM$(RTRIM$(whatfound$)))) LOCATE z, 15 PRINT whatfound$ END SUB DEFSNG C, L, R SUB miscellaneous (level%, good, total) DO endofsession$ = "" randomaccess = INT(RND * 4) + 1 SELECT CASE randomaccess CASE 1 CALL addition(1, endofsession$, level%, good, total) CASE 2 CALL subtraction(1, endofsession$, level%, good, total) CASE 3 CALL division(1, endofsession$, level%, good, total) CASE 4 CALL multiplication(1, endofsession$, level%, good, total) END SELECT LOOP UNTIL endofsession$ <> "" END SUB DEFINT A-Z SUB mouse (cx, dx, bx) POKE VARPTR(a(4)), &H92 CALL absolute(cx, VARPTR(a(0))) cx = (cx / 8) + 1 POKE VARPTR(a(4)), &H91 CALL absolute(dx, VARPTR(a(0))) dx = (dx / 8) + 1 POKE VARPTR(a(4)), &H93 CALL absolute(bx, VARPTR(a(0))) END SUB SUB MousePointer (SW) POKE VARPTR(a(0)) + 1, SW CALL absolute(c, VARPTR(a(0))) END SUB DEFSNG A-Z SUB multiplication (misc, endofsession$, level%, good, total) DO numofdigits = 0 COLOR 7, 3 IF total > 0 THEN LOCATE 21, 26 PRINT USING "###.##"; (good / total) * 100; PRINT " %" END IF 'ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ clearing the working board CALL textbutton(9, 43, 8, 28, 0, 0, 0, "³", 0) LOCATE 17, 43 PRINT SPACE$(20) 'ÍÍÍÍÍÍÍÍÍÍÍÍ COLOR 7, 3 LOCATE 7, 50 PRINT "MULTIPLICATION" COLOR 7, 0 number1 = INT(RND * (20 * level%)) + 1 number2 = INT(RND * (20 * level%)) + 1 LOCATE 9, 59 - LEN(STR$(number1)) PRINT STR$(number1) + " x" LOCATE 10, 59 - LEN(STR$(number2)) PRINT STR$(number2) answer = number1 * number2 LOCATE 11, 59 - LEN(LTRIM$(RTRIM$(STR$(answer)))) PRINT STRING$(LEN(LTRIM$(RTRIM$(STR$(answer)))), "Ä") GOSUB workings COLOR 7, 0 LOCATE 12 + numofEntries, 59 - LEN(LTRIM$(RTRIM$(STR$(answer)))) PRINT STRING$(LEN(RTRIM$(LTRIM$(STR$(answer)))), "Ä") 'ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ DO COLOR 23 LOCATE 11 + currentrow, 58 - numofdigits PRINT "_" COLOR 7 LOCATE 11 + currentrow, 58 - numofdigits - 1 PRINT " " COLOR 7, 3 waitforanswer$ = INKEY$ SELECT CASE waitforanswer$ CASE CHR$(27) CALL textbutton(9, 43, 8, 28, 0, 0, 0, "³", 0) endofsession$ = CHR$(27) EXIT DO CASE CHR$(8) IF 58 - numofdigits + 1 <= 58 THEN LOCATE 11 + currentrow, 58 - numofdigits + 1 PRINT " " numofdigits = numofdigits - 1 END IF CASE CHR$(48) TO CHR$(57) IF numofdigits + 1 < LEN(STR$(answer)) THEN LOCATE 11 + currentrow, 58 - numofdigits PRINT waitforanswer$ numofdigits = numofdigits + 1 END IF CASE CHR$(0) + "P" LOCATE 11 + currentrow, 58 - numofdigits PRINT " " GOSUB changeofline IF currentrow > numofEntries + 1 THEN currentrow = 0 currentrow = currentrow + 1 LOCATE 11 + currentrow, 59 - LEN(LTRIM$(RTRIM$(STR$(answer)))) PRINT SPC(LEN(LTRIM$(STR$(answer)))); CASE CHR$(0) + "H" LOCATE 11 + currentrow, 58 - numofdigits PRINT " " GOSUB changeofline IF currentrow < 2 THEN currentrow = numofEntries + 3 currentrow = currentrow - 1 LOCATE 11 + currentrow, 59 - LEN(LTRIM$(RTRIM$(STR$(answer)))) PRINT SPC(LEN(LTRIM$(STR$(answer)))); CASE CHR$(13) total = total + 1 LOCATE 11 + currentrow, 58 - numofdigits PRINT " " COLOR 7, 0 answerfound$ = "" FOR x% = 44 TO 58 answerfound$ = answerfound$ + CHR$(SCREEN(13 + numofEntries, x%)) NEXT answerfound$ = LTRIM$(RTRIM$(answerfound$)) IF answerfound$ = "" THEN FOR x% = 44 TO 58 answerfound$ = answerfound$ + CHR$(SCREEN(12, x%)) NEXT answerfound$ = LTRIM$(RTRIM$(answerfound$)) END IF IF answerfound$ = LTRIM$(RTRIM$(STR$(answer))) THEN good = good + 1 LOCATE 17, 44 PRINT "Good answer! " COLOR 23, 0 LOCATE 17, 57 PRINT "Please wait" conditionaltiming 2 IF misc = 1 THEN EXIT SUB EXIT DO ELSE LOCATE 17, 44 PRINT "Correct answer is " + LTRIM$(RTRIM$(STR$(answer))) COLOR , 3 LOCATE 19, 48 PRINT "press the space bar." DO LOOP UNTIL INKEY$ = CHR$(32) LOCATE 19, 48 PRINT " " IF misc = 1 THEN EXIT SUB EXIT DO END IF END SELECT LOOP LOOP UNTIL waitforanswer$ = CHR$(27) EXIT SUB 'ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ subroutine 1 workings: COLOR 7, 3 LOCATE 12, 59 - LEN(LTRIM$(STR$(answer))) PRINT SPC(LEN(LTRIM$(STR$(answer)))); numofEntries = LEN(LTRIM$(STR$(number2))) currentrow = 1 RETURN 'ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ subroutine 2 changeofline: numofdigits = 0 COLOR 7, 0 FOR x = 59 - LEN(LTRIM$(RTRIM$(STR$(answer)))) - 2 TO 58 LOCATE 11 + currentrow, x PRINT CHR$(SCREEN(11 + currentrow, x)); NEXT IF waitforanswer$ = CHR$(0) + "H" AND currentrow = numofEntries + 2 THEN currentrow = currentrow - 1 IF waitforanswer$ = CHR$(0) + "P" AND currentrow = numofEntries THEN currentrow = currentrow + 1 COLOR 7, 3 RETURN END SUB SUB subtraction (misc, endofsession$, level%, good, total) 'ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Setting all values to zero DO COLOR 7, 3 IF total > 0 THEN LOCATE 21, 26 PRINT USING "###.##"; (good / total) * 100; PRINT " " END IF numofdigits = 0 'ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ clearing the working board CALL textbutton(9, 43, 8, 28, 0, 0, 0, "³", 0) 'ÍÍÍÍÍÍÍÍÍÍÍÍ COLOR 7, 3 LOCATE 7, 50 PRINT " SUBTRACTION " COLOR 7, 0 number1 = INT(RND * (100 * level%)) number2 = INT(RND * (100 * level%)) IF number2 > number1 THEN SWAP number1, number2 LOCATE 11, 59 - LEN(STR$(number1)) PRINT STR$(number1) + " -" LOCATE 12, 59 - LEN(STR$(number2)) PRINT STR$(number2) answer = number1 - number2 LOCATE 13, 59 - LEN(STR$(answer)) PRINT STRING$(LEN(STR$(answer)), "Ä") DO COLOR 23 LOCATE 14, 58 - numofdigits PRINT "_" COLOR 7 LOCATE 14, 58 - numofdigits - 1 PRINT " " waitforanswer$ = INKEY$ SELECT CASE waitforanswer$ CASE CHR$(27) CALL textbutton(9, 43, 8, 28, 0, 0, 0, "³", 0) endofsession$ = CHR$(27) EXIT DO CASE CHR$(8) IF 58 - numofdigits + 1 <= 58 THEN LOCATE 14, 58 - numofdigits + 1 PRINT " " numofdigits = numofdigits - 1 END IF CASE CHR$(48) TO CHR$(57) IF numofdigits + 1 < LEN(STR$(answer)) THEN LOCATE 14, 58 - numofdigits PRINT waitforanswer$ numofdigits = numofdigits + 1 END IF CASE CHR$(13) total = total + 1 LOCATE 14, 58 - numofdigits PRINT " " answerfound$ = "" FOR x% = 44 TO 58 answerfound$ = answerfound$ + CHR$(SCREEN(14, x%)) NEXT answerfound$ = LTRIM$(RTRIM$(answerfound$)) IF answerfound$ = LTRIM$(RTRIM$(STR$(answer))) THEN good = good + 1 LOCATE 16, 44 PRINT "Good answer!" COLOR 23 LOCATE 17, 44 PRINT "Please wait .." conditionaltiming 2 IF misc = 1 THEN EXIT SUB EXIT DO ELSE LOCATE 16, 44 PRINT "Correct answer is " + LTRIM$(RTRIM$(STR$(answer))) LOCATE 17, 44 PRINT "Press the (SPACE BAR) " DO LOOP UNTIL INKEY$ = CHR$(32) IF misc = 1 THEN EXIT SUB EXIT DO END IF END SELECT LOOP LOOP UNTIL waitforanswer$ = CHR$(27) END SUB SUB test DEFINT C, L, R 'ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Drawing main menu. CALL Testmenu 'ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Waiting for user input. level = 10 z = 9 DO mouse cx%, dx%, bx% a$ = INKEY$ COLOR 7, 3 LOCATE 7, 50 PRINT " Test area " DO WHILE bx% = 1 mouse cx%, dx%, bx% IF cx% >= 9 AND cx% <= 13 AND dx% >= 15 AND dx% <= 30 THEN z = cx% IF cx% <> row1 THEN CALL testmenuscroll CALL found(whatfound$, z, x%) END IF row1 = cx% END IF IF bx% <> 1 AND cx% >= 9 AND cx% <= 13 AND dx% >= 15 AND dx% <= 30 THEN a$ = CHR$(13) IF bx% <> 1 AND cx% >= 15 AND cx% <= 17 AND dx% >= 20 AND dx% <= 24 THEN a$ = "1" IF bx% <> 1 AND cx% >= 15 AND cx% <= 17 AND dx% >= 26 AND dx% <= 30 THEN a$ = "2" IF bx% <> 1 AND cx% >= 15 AND cx% <= 17 AND dx% >= 32 AND dx% <= 36 THEN a$ = "3" IF bx% <> 1 AND cx% >= 20 AND cx% <= 22 AND dx% >= 63 AND dx% <= 72 THEN a$ = CHR$(0) + "=" LOOP SELECT CASE UCASE$(a$) CASE "1" CALL testlevel(1) level = 1 CASE "2" CALL testlevel(2) level = 10 CASE "3" CALL testlevel(3) level = 100 CASE CHR$(0) + "M", CHR$(0) + "P" COLOR 7, 4 IF z < 13 THEN z = z + 1 ELSE z = 9 testmenuscroll CALL found(whatfound$, z, x%) CASE CHR$(0) + "K", CHR$(0) + "H" COLOR 7, 4 IF z > 9 THEN z = z - 1 ELSE z = 13 testmenuscroll CALL found(whatfound$, z, x%) CASE CHR$(13) CALL found(whatfound$, z, x%) PALETTE 4, 0 PALETTE 1, 56 PALETTE 5, 56 SELECT CASE UCASE$(LTRIM$(RTRIM$(whatfound$))) CASE "ADDITION" CALL addition(0, "", level, good, total) CASE "MULTIPLICATION" CALL multiplication(0, "", level, good, total) CASE "DIVISION" CALL division(0, "", level, good, total) CASE "SUBTRACTION" CALL subtraction(0, "", level, good, total) CASE "MISCELLANEOUS" CALL miscellaneous(level, good, total) END SELECT PALETTE 5, 35 PALETTE 4, 24 PALETTE 1, 7 END SELECT LOOP UNTIL bx% = 1 OR a$ = CHR$(0) + "=" END SUB DEFSNG C, L, R SUB testlevel (level) CALL textbutton(15, 20, 2, 5, 4, 5, 0, "º", 1) CALL textbutton(15, 26, 2, 5, 4, 5, 0, "º", 1) CALL textbutton(15, 32, 2, 5, 4, 5, 0, "º", 1) CALL textbutton(15, 14 + (level * 6), 2, 5, 4, 0, 5, "º", 1) COLOR 1, 4 LOCATE 16, 22 PRINT "1" LOCATE 16, 28 PRINT "2" LOCATE 16, 34 PRINT "3" END SUB SUB Testmenu CLS PALETTE 3, 24 PALETTE 5, 35 PALETTE 4, 24 PALETTE 8, 8 PALETTE 2, 35 PALETTE 6, 5 PALETTE 1, 7 CALL backdisplay(1, 1, 24, 80, 2, 0, "°") CALL textbutton(3, 6, 20, 70, 3, 2, 0, "Û", 0) CALL textbutton(4, 27, 2, 26, 3, 2, 0, "³", 0) CALL textbutton(8, 10, 10, 30, 0, 0, 2, "Û", 0) CALL textbutton(8, 42, 10, 30, 0, 0, 2, "Û", 0) CALL textbutton(20, 61, 2, 12, 3, 0, 2, "º", 0) CALL textbutton(20, 10, 2, 50, 3, 0, 2, "º", 0) COLOR 7 LOCATE 25, 22 PRINT "Copyright Hensley Bass. November 1995"; COLOR 7 LOCATE 5, 29 PRINT "SIMPLE OPERATIONS v1.0" LOCATE 7, 19 PRINT "Operation" LOCATE 7, 50 PRINT " Test area " COLOR 7 LOCATE 21, 63 PRINT "F3 Exit" CALL testmenuscroll COLOR , 4 LOCATE 9, 15 PRINT " Addition " COLOR 1, 0 LOCATE 14, 12 PRINT STRING$(26, 196) COLOR 5 LOCATE 16, 12 PRINT "Level" CALL testlevel(2) COLOR 7, 3 LOCATE 21, 12 PRINT "Current rate 0 %" END SUB SUB testmenuscroll COLOR 1, 0 LOCATE 9, 15 PRINT " Addition " LOCATE 10, 15 PRINT " Subtraction " LOCATE 11, 15 PRINT " Division " LOCATE 12, 15 PRINT " Multiplication " LOCATE 13, 15 PRINT " Miscellaneous " END SUB SUB textbutton (x, y, xinc, yinc, gbbg, bs, ds, typ$, tk) IF tk = 4 OR tk = 1 THEN thk$ = "ÿ" SELECT CASE typ$ CASE "³" ul$ = "Ú" uhoz$ = "Ä" lhoz$ = "Ä" ur$ = "¿" vert$ = "³" ll$ = "À" lr$ = "Ù" CASE "º" ul$ = "É" uhoz$ = "Í" lhoz$ = "Í" ur$ = "»" vert$ = "º" ll$ = "È" lr$ = "¼" CASE "Û" ul$ = "Û" uhoz$ = "ß" lhoz$ = "Ü" ur$ = "Û" vert$ = "Û" ll$ = "Û" lr$ = "Û" END SELECT COLOR bs, gbbg LOCATE x, y - tk PRINT thk$ + ul$ + STRING$(yinc - 2, uhoz$); COLOR ds PRINT ur$; thk$ FOR hob = x + 1 TO x + xinc - 1 COLOR bs LOCATE hob, y - tk PRINT thk$; vert$; STRING$(yinc - 2, " "); COLOR ds LOCATE hob, y + yinc - 1 PRINT vert$; thk$; NEXT COLOR bs LOCATE x + xinc, y - tk PRINT thk$; ll$; COLOR ds PRINT STRING$(yinc - 2, lhoz$); COLOR ds PRINT lr$; thk$; IF typ$ = "Û" AND bs <> ds THEN COLOR bs, gbbg LOCATE x + xinc, y PRINT "ß"; COLOR ds LOCATE x, y + yinc - 1 PRINT "Ü"; END IF END SUB