Home » Personal collection » Acorn DFS disks » dfs_box03_disk02_format_some_games.scp » W.CALC » Compare

Compare W.CALC with CALCULATOR

File: Personal collection » Acorn DFS disks » dfs_box03_disk02_format_some_games.scp » W.CALC
Compared with: Personal collection » Acorn tapes » Commercial_Releases » boxed_acornsoft_tape13a_acorn_bbc_welcome_cassette.wav » CALCULATOR
Similarity: 98% of bytes duplicated

170 of 173 lines (98.6%) are identical in the two listings. Duplicated Different

Line numbers are ignored when comparing lines, so that renumbered programs still match.

W.CALC CALCULATOR
10 REM CALCULATOR 10 REM CALCULATOR
12 REM Program by Tim Dobson (ACORNSOFT) and Richard G Warner 12 REM Program by Tim Dobson (ACORNSOFT) and Richard G Warner
14 REM For BBC Model A Microcomputer 16K Minimum 14 REM For BBC Model A Microcomputer 16K Minimum
40 ON ERROR GOTO50 40 ON ERROR GOTO50
50 MODE7 50 MODE7:IF M%=0 THEN PRINTTAB(5,16);"Press the STOP button"'" on your tape recorder":PROCSPACE
60 CLS:ON ERROR GOTO800 60 CLS:ON ERROR GOTO800
100 PROCTITLEPAGE 100 PROCTITLEPAGE
110 PROCINITIALISE 110 PROCINITIALISE
120 PROCINSTRUCTIONS 120 PROCINSTRUCTIONS
200 PROCSCREEN 200 PROCSCREEN
210 PRINTTAB(7,4);"Enter your expression now" 210 PRINTTAB(7,4);"Enter your expression now"
220 V%=0:B$="":IN%=0:@%=0 220 V%=0:B$="":IN%=0:@%=0
300 VDU26:IF MEM$>"" THEN PRINTTAB(12,20);"Memories in use"''MEM$ 300 VDU26:IF MEM$>"" THEN PRINTTAB(12,20);"Memories in use"''MEM$
310 VDU28,0,19,39,5:PROCON 310 VDU28,0,19,39,5:PROCON
320 PRINTTAB(0,V%);" ] ";B$; 320 PRINTTAB(0,V%);" ] ";B$;
330 PROCGETLINE:PROCOFF 330 PROCGETLINE:PROCOFF
340 IF KEY%=130 THEN 200 340 IF KEY%=130 THEN 200
350 B=FNEVAL(B$) 350 B=FNEVAL(B$)
400 B$=STR$(B):F%(0)=LEN(B$):f%(0)=LEN(B$) 400 B$=STR$(B):F%(0)=LEN(B$):f%(0)=LEN(B$)
410 PRINT:IN%=1:V%=VPOS:GOTO300 410 PRINT:IN%=1:V%=VPOS:GOTO300
800 IF ERR=17 THEN 900 800 IF ERR=17 THEN 900
810 IF ER$="" THEN REPORT ELSE PRINT'ER$; 810 IF ER$="" THEN REPORT ELSE PRINT'ER$;
820 GOTO400 820 GOTO400
900 VDU26:CLS 900 VDU26:CLS
910 PRINTTAB(5,9); 910 PRINTTAB(5,9);
920 PRINT"Do you want to go on to" 920 PRINT"Do you want to go on to"
930 PRINT" the next program (Y/N)? "; 930 PRINT" the next program (Y/N)? ";
940 PROCYN:IF Y%<0 THEN 910 940 PROCYN:IF Y%<0 THEN 910
950 IF Y%=0 THEN 200 950 IF Y%=0 THEN 200
970 CHAIN "ALPHA" 970 CLS:IF M%=0 THEN PRINTTAB(5,5);"Press the PLAY button"'" on your tape recorder"
990 CHAIN""
1000 DEFPROCGETLINE 1000 DEFPROCGETLINE
1200 KEY%=GET:IF KEY%=130 OR KEY%=13 THEN 1999 1200 KEY%=GET:IF KEY%=130 OR KEY%=13 THEN 1999
1210 IF KEY%<>127 THEN 1300 1210 IF KEY%<>127 THEN 1300
1220 IF IN%=0 THEN 1200 1220 IF IN%=0 THEN 1200
1230 IN%=IN%-1 1230 IN%=IN%-1
1240 FORJ%=1TOF%(IN%):PRINTCHR$(&7F);:NEXT 1240 FORJ%=1TOF%(IN%):PRINTCHR$(&7F);:NEXT
1250 B$=LEFT$(B$,LEN(B$)-f%(IN%)):GOTO1200 1250 B$=LEFT$(B$,LEN(B$)-f%(IN%)):GOTO1200
1300 IF LEN(B$)>69 OR KEY%<32 THENVDU7:GOTO1200 1300 IF LEN(B$)>69 OR KEY%<32 THENVDU7:GOTO1200
1310 KEY$=CHR$(KEY%):key$=KEY$ 1310 KEY$=CHR$(KEY%):key$=KEY$
1320 I%=INSTR(";:=?[]{}`_",KEY$):IF I%>0 THEN KEY$=MID$("+*-/()()--",I%,1):key$=KEY$ 1320 I%=INSTR(";:=?[]{}`_",KEY$):IF I%>0 THEN KEY$=MID$("+*-/()()--",I%,1):key$=KEY$
1330 IF KEY%>127 THEN KEY%=KEY%-127:KEY$=FUNC$(KEY%):key$=func$(KEY%) 1330 IF KEY%>127 THEN KEY%=KEY%-127:KEY$=FUNC$(KEY%):key$=func$(KEY%)
1340 F%(IN%)=LEN(KEY$):f%(IN%)=LEN(key$) 1340 F%(IN%)=LEN(KEY$):f%(IN%)=LEN(key$)
1350 IN%=IN%+1:PRINTKEY$;:B$=B$+key$:GOTO1200 1350 IN%=IN%+1:PRINTKEY$;:B$=B$+key$:GOTO1200
1999 ENDPROC 1999 ENDPROC
2000 DEFFNEVAL(Z$) 2000 DEFFNEVAL(Z$)
2010 LOCAL X,Y%,Z% 2010 LOCAL X,Y%,Z%
2020 IF ASC(Z$)=32 THEN Z$=MID$(Z$,2):GOTO2020 2020 IF ASC(Z$)=32 THEN Z$=MID$(Z$,2):GOTO2020
2030 IF Z$="" THEN =0 2030 IF Z$="" THEN =0
2040 FLAG%=0 2040 FLAG%=0
2100 REM Check for INV 2100 REM Check for INV
2110 Z%=INSTR(Z$,CHR$&89):IF Z%=0 THEN 2200 2110 Z%=INSTR(Z$,CHR$&89):IF Z%=0 THEN 2200
2120 REM Check for SIN 2120 REM Check for SIN
2130 IF MID$(Z$,Z%+1,3)=func$(6) THEN Z$=LEFT$(Z$,Z%-1)+" ASN"+MID$(Z$,Z%+4):GOTO2110 2130 IF MID$(Z$,Z%+1,3)=func$(6) THEN Z$=LEFT$(Z$,Z%-1)+" ASN"+MID$(Z$,Z%+4):GOTO2110
2140 REM Check for COS 2140 REM Check for COS
2150 IF MID$(Z$,Z%+1,3)=func$(7) THEN Z$=LEFT$(Z$,Z%-1)+" ACS"+MID$(Z$,Z%+4):GOTO2110 2150 IF MID$(Z$,Z%+1,3)=func$(7) THEN Z$=LEFT$(Z$,Z%-1)+" ACS"+MID$(Z$,Z%+4):GOTO2110
2160 REM Check for TAN 2160 REM Check for TAN
2170 IF MID$(Z$,Z%+1,3)=func$(8) THEN Z$=LEFT$(Z$,Z%-1)+" ATN"+MID$(Z$,Z%+4):GOTO2110 2170 IF MID$(Z$,Z%+1,3)=func$(8) THEN Z$=LEFT$(Z$,Z%-1)+" ATN"+MID$(Z$,Z%+4):GOTO2110
2180 ER$="INV without SIN,COS or TAN":ERROR 2180 ER$="INV without SIN,COS or TAN":ERROR
2200 REM Check for RECALL 2200 REM Check for RECALL
2210 Z%=INSTR(Z$,CHR$&82):IF Z%=0 THEN 2300 2210 Z%=INSTR(Z$,CHR$&82):IF Z%=0 THEN 2300
2220 ER$="Number after RECALL out of range" 2220 ER$="Number after RECALL out of range"
2230 Y%=EVAL(MID$(Z$,Z%+1,1)):IF Y%<0 OR Y%>9 THEN ERROR 2230 Y%=EVAL(MID$(Z$,Z%+1,1)):IF Y%<0 OR Y%>9 THEN ERROR
2240 X=STORE(Y%) 2240 X=STORE(Y%)
2250 Z$=LEFT$(Z$,Z%-1)+STR$(X)+MID$(Z$,Z%+2):GOTO2210 2250 Z$=LEFT$(Z$,Z%-1)+STR$(X)+MID$(Z$,Z%+2):GOTO2210
2300 REM Check for STORE 2300 REM Check for STORE
2310 Z%=INSTR(Z$,CHR$&81):IF Z%=0 THEN2400 2310 Z%=INSTR(Z$,CHR$&81):IF Z%=0 THEN2400
2320 ER$="Invalid expression after STORE" 2320 ER$="Invalid expression after STORE"
2330 Y%=EVAL(MID$(Z$,Z%+1)):IF Y%<0 OR Y%>9 THEN ERROR 2330 Y%=EVAL(MID$(Z$,Z%+1)):IF Y%<0 OR Y%>9 THEN ERROR
2340 ER$="Invalid expression before STORE" 2340 ER$="Invalid expression before STORE"
2350 X=EVAL(LEFT$(Z$,Z%-1)) 2350 X=EVAL(LEFT$(Z$,Z%-1))
2360 STORE(Y%)=X:Y$=STR$(Y%):IF MEM$="" THEN 2380 2360 STORE(Y%)=X:Y$=STR$(Y%):IF MEM$="" THEN 2380
2370 IF INSTR(MEM$,Y$)>0 THEN 2390 2370 IF INSTR(MEM$,Y$)>0 THEN 2390
2380 MEM$=MEM$+" "+Y$ 2380 MEM$=MEM$+" "+Y$
2390 =X 2390 =X
2400 ER$="":=EVAL("0+"+Z$) 2400 ER$="":=EVAL("0+"+Z$)
5000 DEFPROCINITIALISE 5000 DEFPROCINITIALISE
5010 DIM FUNC$(10),func$(10),STORE(9),F%(79),f%(79) 5010 DIM FUNC$(10),func$(10),STORE(9),F%(79),f%(79)
5030 DATA" STORE "," RECALL "," CLEAR ","%","SQR ","SIN ","COS ","TAN ","INV ","^" 5030 DATA" STORE "," RECALL "," CLEAR ","%","SQR ","SIN ","COS ","TAN ","INV ","^"
5040 DATA"/100","SQR","SIN","COS","TAN" 5040 DATA"/100","SQR","SIN","COS","TAN"
5050 FORI%=1TO10:READ FUNC$(I%):NEXT 5050 FORI%=1TO10:READ FUNC$(I%):NEXT
5060 FORI%=1TO10:func$(I%)=CHR$(128+I%):NEXT 5060 FORI%=1TO10:func$(I%)=CHR$(128+I%):NEXT
5070 FORI%=4TO8:READ func$(I%):NEXT 5070 FORI%=4TO8:READ func$(I%):NEXT
5080 func$(10)="^" 5080 func$(10)="^"
5100 MEM$="" 5100 MEM$=""
5200 *KEY 0 "|!|@" 5200 *KEY 0 "|!|@"
5210 *KEY 1 "|!|A" 5210 *KEY 1 "|!|A"
5220 *KEY 2 "|!|B" 5220 *KEY 2 "|!|B"
5230 *KEY 3 "|!|C" 5230 *KEY 3 "|!|C"
5240 *KEY 4 "|!|D" 5240 *KEY 4 "|!|D"
5250 *KEY 5 "|!|E" 5250 *KEY 5 "|!|E"
5260 *KEY 6 "|!|F" 5260 *KEY 6 "|!|F"
5270 *KEY 7 "|!|G" 5270 *KEY 7 "|!|G"
5280 *KEY 8 "|!|H" 5280 *KEY 8 "|!|H"
5290 *KEY 9 "|!|I" 5290 *KEY 9 "|!|I"
5299 ENDPROC 5299 ENDPROC
6000 DEFPROCINSTRUCTIONS 6000 DEFPROCINSTRUCTIONS
6010 PROCSCREEN 6010 PROCSCREEN
6020 PRINT'" This program converts your"'" computer into a simple calculator."' 6020 PRINT'" This program converts your"'" computer into a simple calculator."'
6030 PRINT''" The program makes available the" 6030 PRINT''" The program makes available the"
6040 PRINT" keys 1 - 0 and the full stop key" 6040 PRINT" keys 1 - 0 and the full stop key"
6050 PRINT" to enter numbers."'' 6050 PRINT" to enter numbers."''
6060 PRINT" The keystrokes +, -, *, / are" 6060 PRINT" The keystrokes +, -, *, / are"
6070 PRINT" used for the operations of"'" addition, subtraction," 6070 PRINT" used for the operations of"'" addition, subtraction,"
6080 PRINT" multiplication and division"'" respectively." 6080 PRINT" multiplication and division"'" respectively."
6090 PROCSPACE 6090 PROCSPACE
6100 PROCSCREEN 6100 PROCSCREEN
6110 PRINT'" The calculator operates in"'" algebraic mode, that is, you can" 6110 PRINT'" The calculator operates in"'" algebraic mode, that is, you can"
6120 PRINT" type in an expression just as you"'" would write it."' 6120 PRINT" type in an expression just as you"'" would write it."'
6130 PRINT" However, multiplication and"'" division take precedence over" 6130 PRINT" However, multiplication and"'" division take precedence over"
6140 PRINT" addition and subtraction, so that"'" for example :"' 6140 PRINT" addition and subtraction, so that"'" for example :"'
6150 PRINTSPC(10)"3/4+5*7.1-6/.2"''SPC(8)"is interpreted as"' 6150 PRINTSPC(10)"3/4+5*7.1-6/.2"''SPC(8)"is interpreted as"'
6160 PRINTSPC(7)"(3/4)+(5*7.1)-(6/.2)" 6160 PRINTSPC(7)"(3/4)+(5*7.1)-(6/.2)"
6190 PROCSPACE 6190 PROCSPACE
6200 PROCSCREEN 6200 PROCSCREEN
6210 PRINT''" Round brackets ( ) are"'" available to override the order of" 6210 PRINT''" Round brackets ( ) are"'" available to override the order of"
6220 PRINT" execution."'' 6220 PRINT" execution."''
6230 PRINT" Anything in brackets is worked"'" out before anything else."'' 6230 PRINT" Anything in brackets is worked"'" out before anything else."''
6240 PRINT" The innermost brackets are"'" evaluated first."' 6240 PRINT" The innermost brackets are"'" evaluated first."'
6290 PROCSPACE 6290 PROCSPACE
6300 PROCSCREEN 6300 PROCSCREEN
6310 PRINT'" In this program the red"'" user-definable keys have special" 6310 PRINT'" In this program the red"'" user-definable keys have special"
6320 PRINT" functions, which are:-"' 6320 PRINT" functions, which are:-"'
6330 PRINT" f0 - STORE"'" f1 - RECALL"'" f2 - CLEAR"'" f3 - %" 6330 PRINT" f0 - STORE"'" f1 - RECALL"'" f2 - CLEAR"'" f3 - %"
6340 PRINT" f4 - SQR (square root)"'" f5 - SIN (sine of radian angle)" 6340 PRINT" f4 - SQR (square root)"'" f5 - SIN (sine of radian angle)"
6350 PRINT" f6 - COS (cosine of radian angle)"'" f7 - TAN (tangent of radian angle)" 6350 PRINT" f6 - COS (cosine of radian angle)"'" f7 - TAN (tangent of radian angle)"
6360 PRINT" f8 - INV (for inverse"'TAB(13)"trigonometric functions)" 6360 PRINT" f8 - INV (for inverse"'TAB(13)"trigonometric functions)"
6370 PRINT" f9 - ^ (raise to power)" 6370 PRINT" f9 - ^ (raise to power)"
6390 PROCSPACE 6390 PROCSPACE
6400 PROCSCREEN 6400 PROCSCREEN
6410 PRINT'" The calculator has ten"'" ""memories"", numbered from 0 to 9" 6410 PRINT'" The calculator has ten"'" ""memories"", numbered from 0 to 9"
6420 PRINT" in each of which can be stored a"'" number."'' 6420 PRINT" in each of which can be stored a"'" number."''
6430 PRINT" To store the result of a"'" calculation in a memory, just" 6430 PRINT" To store the result of a"'" calculation in a memory, just"
6440 PRINT" enter the expression and then"'" press key f0 (STORE) followed by" 6440 PRINT" enter the expression and then"'" press key f0 (STORE) followed by"
6450 PRINT" a number from 0 to 9."'''" To recall the contents of a"'" memory, press key f1 ( RECALL )" 6450 PRINT" a number from 0 to 9."'''" To recall the contents of a"'" memory, press key f1 ( RECALL )"
6460 PRINT" followed by a number from 0 to 9." 6460 PRINT" followed by a number from 0 to 9."
6490 PROCSPACE 6490 PROCSPACE
6499 ENDPROC 6499 ENDPROC
7000 DEFPROCSCREEN 7000 DEFPROCSCREEN
7020 VDU26:CLS 7020 VDU26:CLS
7030 PROCDBL("Calculator Program",10,1) 7030 PROCDBL("Calculator Program",10,1)
7089 REMVDU28,0,24,39,3 7089 REMVDU28,0,24,39,3
7099 ENDPROC 7099 ENDPROC
8000 DEFPROCDBL(X$,X,Y) 8000 DEFPROCDBL(X$,X,Y)
8010 PRINTTAB(X-1,Y);CHR$(141);X$ 8010 PRINTTAB(X-1,Y);CHR$(141);X$
8020 PRINTTAB(X-1,Y+1);CHR$(141);X$ 8020 PRINTTAB(X-1,Y+1);CHR$(141);X$
8099 ENDPROC 8099 ENDPROC
8100 DEFPROCWAIT(X) 8100 DEFPROCWAIT(X)
8110 LOCAL Z 8110 LOCAL Z
8120 Z=TIME 8120 Z=TIME
8130 REPEAT UNTIL TIME-Z>X*100 8130 REPEAT UNTIL TIME-Z>X*100
8199 ENDPROC 8199 ENDPROC
8200 DEFPROCSPACE 8200 DEFPROCSPACE
8220 PRINTTAB(3,22);"Press the SPACE BAR to continue";:PROCKCL:PROCOFF 8220 PRINTTAB(3,22);"Press the SPACE BAR to continue";:PROCKCL:PROCOFF
8240 REPEAT UNTIL GET$=" " 8240 REPEAT UNTIL GET$=" "
8299 ENDPROC 8299 ENDPROC
8300 DEFPROCTITLEPAGE 8300 DEFPROCTITLEPAGE
8310 CLS:PROCDBL("CALCULATOR",13,10) 8310 CLS:PROCDBL("CALCULATOR",13,10)
8320 PROCOFF:I%=INKEY(500) 8320 PROCOFF:I%=INKEY(500)
8399 ENDPROC 8399 ENDPROC
8800 DEFPROCKCL 8800 DEFPROCKCL
8810 REPEAT UNTIL INKEY(0)=-1 8810 REPEAT UNTIL INKEY(0)=-1
8899 ENDPROC 8899 ENDPROC
8900 DEFPROCOFF 8900 DEFPROCOFF
8910 VDU23;8202;0;0;0;:ENDPROC 8910 VDU23;8202;0;0;0;:ENDPROC
8950 DEFPROCON 8950 DEFPROCON
8960 VDU23;29194;0;0;0;:ENDPROC 8960 VDU23;29194;0;0;0;:ENDPROC
9200 DEFPROCYN 9200 DEFPROCYN
9210 Y%=-1 9210 Y%=-1
9220 X%=GET:IF X%=13 AND Y%>=0 THENENDPROC 9220 X%=GET:IF X%=13 AND Y%>=0 THENENDPROC
9230 X%=X%AND&DF:IFX%<>78ANDX%<>89THEN9220 9230 X%=X%AND&DF:IFX%<>78ANDX%<>89THEN9220
9240 Y%=1:IFX%=78THENY%=0 9240 Y%=1:IFX%=78THENY%=0
9250 PRINTCHR$X%;CHR$8;:GOTO9220 9250 PRINTCHR$X%;CHR$8;:GOTO9220