Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199312.adf » !BasicProg_BasicProg » Listing1

Listing1

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199312.adf » !BasicProg_BasicProg
Filename: Listing1
Read OK:
File size: 031C bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >Listing1
   20:
   30ON ERROR REPORT:PRINT " at line ";ERL/10:END
   40MODE 0
   50:
   60PRINT "Which rule do you want to test?"
   70PRINT "  (A)ddition"
   80PRINT "  (S)ubtraction"
   90PRINT "  (M)ultiplication"
  100PRINT "  (D)ivision"
  110INPUT "Please enter A,S,M or D: "rule$
  120:
  130CASE rule$ OF
  140 WHEN "A"
  150  A=RND(10):B=RND(10)
  160  PRINT "What is ";A;" + ";B;" ";
  170  INPUT result
  180  IF result=A+B THEN PRINT "Correct" ELSE PRINT "Wrong"
  190 WHEN "S"
  200  A=RND(10):B=RND(10)
  210  PRINT "What is ";A;" - ";B;" ";
  220  INPUT result
  230  IF result=A-B THEN PRINT "Correct" ELSE PRINT "Wrong"
  240 WHEN "M"
  250  A=RND(10):B=RND(10)
  260  PRINT "What is ";A;" x ";B;" ";
  270  INPUT result
  280  IF result=A*B THEN PRINT "Correct" ELSE PRINT "Wrong"
  290 WHEN "D"
  300  B=RND(10):A=B*RND(10)
  310  PRINT "What is ";A;" / ";B;" ";
  320  INPUT result
  330  IF result=A/B THEN PRINT "Correct" ELSE PRINT "Wrong"
  340 OTHERWISE
  350  PRINT "Sorry, I don't know that rule."
  360 ENDCASE
  370END

� >Listing1
:
� � �:� " at line ";�/10:�
(� 0
2:
<'� "Which rule do you want to test?"
F� "  (A)ddition"
P� "  (S)ubtraction"
Z� "  (M)ultiplication"
d� "  (D)ivision"
n&� "Please enter A,S,M or D: "rule$
x:
�Ȏ rule$ �
�
 � "A"
�  A=�(10):B=�(10)
�!  � "What is ";A;" + ";B;" ";
�  � result
�,  � result=A+B � � "Correct" � � "Wrong"
�
 � "S"
�  A=�(10):B=�(10)
�!  � "What is ";A;" - ";B;" ";
�  � result
�,  � result=A-B � � "Correct" � � "Wrong"
�
 � "M"
�  A=�(10):B=�(10)
!  � "What is ";A;" x ";B;" ";
  � result
,  � result=A*B � � "Correct" � � "Wrong"
"
 � "D"
,  B=�(10):A=B*�(10)
6!  � "What is ";A;" / ";B;" ";
@  � result
J,  � result=A/B � � "Correct" � � "Wrong"
T 
^(  � "Sorry, I don't know that rule."
h �
r�
�
00000000  0d 00 0a 0f f4 20 3e 4c  69 73 74 69 6e 67 31 0d  |..... >Listing1.|
00000010  00 14 05 3a 0d 00 1e 1e  ee 20 85 20 f6 3a f1 20  |...:..... . .:. |
00000020  22 20 61 74 20 6c 69 6e  65 20 22 3b 9e 2f 31 30  |" at line ";./10|
00000030  3a e0 0d 00 28 07 eb 20  30 0d 00 32 05 3a 0d 00  |:...(.. 0..2.:..|
00000040  3c 27 f1 20 22 57 68 69  63 68 20 72 75 6c 65 20  |<'. "Which rule |
00000050  64 6f 20 79 6f 75 20 77  61 6e 74 20 74 6f 20 74  |do you want to t|
00000060  65 73 74 3f 22 0d 00 46  14 f1 20 22 20 20 28 41  |est?"..F.. "  (A|
00000070  29 64 64 69 74 69 6f 6e  22 0d 00 50 17 f1 20 22  |)ddition"..P.. "|
00000080  20 20 28 53 29 75 62 74  72 61 63 74 69 6f 6e 22  |  (S)ubtraction"|
00000090  0d 00 5a 1a f1 20 22 20  20 28 4d 29 75 6c 74 69  |..Z.. "  (M)ulti|
000000a0  70 6c 69 63 61 74 69 6f  6e 22 0d 00 64 14 f1 20  |plication"..d.. |
000000b0  22 20 20 28 44 29 69 76  69 73 69 6f 6e 22 0d 00  |"  (D)ivision"..|
000000c0  6e 26 e8 20 22 50 6c 65  61 73 65 20 65 6e 74 65  |n&. "Please ente|
000000d0  72 20 41 2c 53 2c 4d 20  6f 72 20 44 3a 20 22 72  |r A,S,M or D: "r|
000000e0  75 6c 65 24 0d 00 78 05  3a 0d 00 82 0e c8 8e 20  |ule$..x.:...... |
000000f0  72 75 6c 65 24 20 ca 0d  00 8c 0a 20 c9 20 22 41  |rule$ ..... . "A|
00000100  22 0d 00 96 15 20 20 41  3d b3 28 31 30 29 3a 42  |"....  A=.(10):B|
00000110  3d b3 28 31 30 29 0d 00  a0 21 20 20 f1 20 22 57  |=.(10)...!  . "W|
00000120  68 61 74 20 69 73 20 22  3b 41 3b 22 20 2b 20 22  |hat is ";A;" + "|
00000130  3b 42 3b 22 20 22 3b 0d  00 aa 0e 20 20 e8 20 72  |;B;" ";....  . r|
00000140  65 73 75 6c 74 0d 00 b4  2c 20 20 e7 20 72 65 73  |esult...,  . res|
00000150  75 6c 74 3d 41 2b 42 20  8c 20 f1 20 22 43 6f 72  |ult=A+B . . "Cor|
00000160  72 65 63 74 22 20 8b 20  f1 20 22 57 72 6f 6e 67  |rect" . . "Wrong|
00000170  22 0d 00 be 0a 20 c9 20  22 53 22 0d 00 c8 15 20  |".... . "S".... |
00000180  20 41 3d b3 28 31 30 29  3a 42 3d b3 28 31 30 29  | A=.(10):B=.(10)|
00000190  0d 00 d2 21 20 20 f1 20  22 57 68 61 74 20 69 73  |...!  . "What is|
000001a0  20 22 3b 41 3b 22 20 2d  20 22 3b 42 3b 22 20 22  | ";A;" - ";B;" "|
000001b0  3b 0d 00 dc 0e 20 20 e8  20 72 65 73 75 6c 74 0d  |;....  . result.|
000001c0  00 e6 2c 20 20 e7 20 72  65 73 75 6c 74 3d 41 2d  |..,  . result=A-|
000001d0  42 20 8c 20 f1 20 22 43  6f 72 72 65 63 74 22 20  |B . . "Correct" |
000001e0  8b 20 f1 20 22 57 72 6f  6e 67 22 0d 00 f0 0a 20  |. . "Wrong".... |
000001f0  c9 20 22 4d 22 0d 00 fa  15 20 20 41 3d b3 28 31  |. "M"....  A=.(1|
00000200  30 29 3a 42 3d b3 28 31  30 29 0d 01 04 21 20 20  |0):B=.(10)...!  |
00000210  f1 20 22 57 68 61 74 20  69 73 20 22 3b 41 3b 22  |. "What is ";A;"|
00000220  20 78 20 22 3b 42 3b 22  20 22 3b 0d 01 0e 0e 20  | x ";B;" ";.... |
00000230  20 e8 20 72 65 73 75 6c  74 0d 01 18 2c 20 20 e7  | . result...,  .|
00000240  20 72 65 73 75 6c 74 3d  41 2a 42 20 8c 20 f1 20  | result=A*B . . |
00000250  22 43 6f 72 72 65 63 74  22 20 8b 20 f1 20 22 57  |"Correct" . . "W|
00000260  72 6f 6e 67 22 0d 01 22  0a 20 c9 20 22 44 22 0d  |rong"..". . "D".|
00000270  01 2c 17 20 20 42 3d b3  28 31 30 29 3a 41 3d 42  |.,.  B=.(10):A=B|
00000280  2a b3 28 31 30 29 0d 01  36 21 20 20 f1 20 22 57  |*.(10)..6!  . "W|
00000290  68 61 74 20 69 73 20 22  3b 41 3b 22 20 2f 20 22  |hat is ";A;" / "|
000002a0  3b 42 3b 22 20 22 3b 0d  01 40 0e 20 20 e8 20 72  |;B;" ";..@.  . r|
000002b0  65 73 75 6c 74 0d 01 4a  2c 20 20 e7 20 72 65 73  |esult..J,  . res|
000002c0  75 6c 74 3d 41 2f 42 20  8c 20 f1 20 22 43 6f 72  |ult=A/B . . "Cor|
000002d0  72 65 63 74 22 20 8b 20  f1 20 22 57 72 6f 6e 67  |rect" . . "Wrong|
000002e0  22 0d 01 54 06 20 7f 0d  01 5e 28 20 20 f1 20 22  |"..T. ...^(  . "|
000002f0  53 6f 72 72 79 2c 20 49  20 64 6f 6e 27 74 20 6b  |Sorry, I don't k|
00000300  6e 6f 77 20 74 68 61 74  20 72 75 6c 65 2e 22 0d  |now that rule.".|
00000310  01 68 06 20 cb 0d 01 72  05 e0 0d ff              |.h. ...r....|
0000031c