Home » Recent acquisitions » Acorn tapes » tape045b_acorn_acorn_user_1985_04_electron.wav » FORUM2

FORUM2

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 tapes » tape045b_acorn_acorn_user_1985_04_electron.wav
Filename: FORUM2
Read OK:
File size: 07D9 bytes
Load address: FFFF1900
Exec address: FFFF1900
Duplicates

There are 2 duplicate copies of this file in the archive:

File contents
   10 REM PROC_search
   20 REM by Stewart Marshall
   30 REM For BBC and Electron
   40 REM (c) Acorn User April 1985
   50 :
   60 MODE 6
   70 CLS
   80 PRINT TAB(3,4);STRING$(31,"*")
   90 PRINT TAB(3,5);"*"TAB(33,5);"*"
  100 PRINT TAB(3,6);"*"TAB(13,6);"PROC_search"TAB(33,6);"*"  
  110 PRINT TAB(3,7);"*"TAB(33,7);"*"  
  120 PRINT TAB(3,8);STRING$(31,"*")
  130 PRINT
  140 PRINT "This procedure searches for a specified"
  150 PRINT "word or series of words in the answer"
  160 PRINT "inputted by the student. It ignores any" 
  170 PRINT "extra words, spelling mistakes and"
  180 PRINT "typing errors that the student might"
  190 PRINT "make." 
  200 PRINT
  210 PRINT "What follows is a test-drive program."
  220 PRINT TAB(0,22);"Press any key."
  230 A$=GET$
  240 CLS
  250 REPEAT  
  260 PRINT TAB(0,5);"WORDS REQUIRED BY TEACHER"
  270 INPUT TAB(0,7) teacher$
  280 PRINT TAB(0,10);"STUDENT'S ANSWER TO BE CHECKED" 
  290 INPUT TAB(0,12) student$
  300 PROC_search(student$,teacher$) 
  310 IF FD%=1 THEN PRINT TAB(0,15);"That's correct. Very good." ELSE PRINT TAB(0,15);"Sorry, but that's not correct."
  320 PRINT TAB(0,18);"TEST DRIVE AGAIN (Y/N)"
  330 again$=GET$
  340 CLS
  350 PROC_search(again$,"N")
  360 UNTIL FD%=1
  370 END
  380 :
  390 DEF PROC_search(reply$,answer$) 
  400 reply$=" "+reply$
  410 IF reply$=" " THEN PRINT "You don't seem to have typed anything."
  420 FD%=0:SPACE%=0:LK%=1:R%=0 
  430 REM   Removing all but the bare
  440 REM   essentials from the answer$
  450 VOWEL$="AEIOUYHaeiouyh"
  460 an$=LEFT$(answer$,1)
  470 FOR N=2 TO LEN(answer$)
  480 X%=0
  490 IF MID$(answer$,N-1,2)="SC" OR MID$(answer$,N-1,2)="sc" THEN X%=1
  500 IF MID$(answer$,N,1)=MID$(answer$,N-1,1) THEN X%=1
  510 FOR Y=1 TO LEN(VOWEL$)
  520 IF MID$(answer$,N,1)=MID$(VOWEL$,Y,1) THEN X%=1
  530 NEXT Y  
  540 IF MID$(answer$,N-1,1)=" " THEN X%=0
  550 IF X%=0 THEN an$=an$+MID$(answer$,N,1)
  560 NEXT N
  570 REM    Checking the reply$
  580 REPEAT
  590   R%=R%+1  
  600   Aasc%=ASC(MID$(an$,LK%,1)) 
  610   Rasc%=ASC(MID$(reply$,R%,1))
  620   IF Aasc%=32 THEN SPACE%=LK% 
  630   IF Rasc%>96 THEN Rasc%=Rasc%-32
  640   IF Aasc%>96 THEN Aasc%=Aasc%-32
  650   IF Aasc%=67 THEN Aasc%=83
  660   IF Rasc%=67 THEN Rasc%=83 
  670   IF Rasc%=Aasc% THEN PROC_found ELSE PROC_notfound
  680 UNTIL R%=LEN(reply$) OR FD%=1 
  690 ENDPROC   
  700 :
  710 DEF PROC_notfound 
  720 IF Rasc%=32 THEN LK%=SPACE%+1 
  730 ENDPROC
  740 :
  750 DEF PROC_found 
  760 IF LK%=LEN(an$) THEN FD%=1 ELSE LK%=LK%+1    
  770 ENDPROC

 � PROC_search
 � by Stewart Marshall
 � For BBC and Electron
(  � (c) Acorn User April 1985
2 :
< � 6
F �
P � �3,4);�31,"*")
Z � �3,5);"*"�33,5);"*"
d0 � �3,6);"*"�13,6);"PROC_search"�33,6);"*"  
n � �3,7);"*"�33,7);"*"  
x � �3,8);�31,"*")
� �
�0 � "This procedure searches for a specified"
�. � "word or series of words in the answer"
�1 � "inputted by the student. It ignores any" 
�+ � "extra words, spelling mistakes and"
�- � "typing errors that the student might"
� � "make." 
� �
�. � "What follows is a test-drive program."
� � �0,22);"Press any key."
�	 A$=�
� �
� �  
( � �0,5);"WORDS REQUIRED BY TEACHER"
 � �0,7) teacher$
/ � �0,10);"STUDENT'S ANSWER TO BE CHECKED" 
" � �0,12) student$
,! �_search(student$,teacher$) 
6` � FD%=1 � � �0,15);"That's correct. Very good." � � �0,15);"Sorry, but that's not correct."
@& � �0,18);"TEST DRIVE AGAIN (Y/N)"
J
 again$=�
T �
^ �_search(again$,"N")
h � FD%=1
r �
| :
�  � �_search(reply$,answer$) 
� reply$=" "+reply$
�> � reply$=" " � � "You don't seem to have typed anything."
� FD%=0:SPACE%=0:LK%=1:R%=0 
�" �   Removing all but the bare
�$ �   essentials from the answer$
� VOWEL$="AEIOUYHaeiouyh"
� an$=�answer$,1)
� � N=2 � �(answer$)
�	 X%=0
�9 � �answer$,N-1,2)="SC" � �answer$,N-1,2)="sc" � X%=1
�+ � �answer$,N,1)=�answer$,N-1,1) � X%=1
� � Y=1 � �(VOWEL$)
( � �answer$,N,1)=�VOWEL$,Y,1) � X%=1

 � Y  
! � �answer$,N-1,1)=" " � X%=0
&# � X%=0 � an$=an$+�answer$,N,1)
0 � N
: �    Checking the reply$
D �
N   R%=R%+1  
X   Aasc%=�(�an$,LK%,1)) 
b   Rasc%=�(�reply$,R%,1))
l   � Aasc%=32 � SPACE%=LK% 
v"   � Rasc%>96 � Rasc%=Rasc%-32
�"   � Aasc%>96 � Aasc%=Aasc%-32
�   � Aasc%=67 � Aasc%=83
�   � Rasc%=67 � Rasc%=83 
�+   � Rasc%=Aasc% � �_found � �_notfound
� � R%=�(reply$) � FD%=1 
�	 �   
� :
� � �_notfound 
� � Rasc%=32 � LK%=SPACE%+1 
� �
� :
� � �_found 
�) � LK%=�(an$) � FD%=1 � LK%=LK%+1    
 �
�
00000000  0d 00 0a 12 20 f4 20 50  52 4f 43 5f 73 65 61 72  |.... . PROC_sear|
00000010  63 68 0d 00 14 1a 20 f4  20 62 79 20 53 74 65 77  |ch.... . by Stew|
00000020  61 72 74 20 4d 61 72 73  68 61 6c 6c 0d 00 1e 1b  |art Marshall....|
00000030  20 f4 20 46 6f 72 20 42  42 43 20 61 6e 64 20 45  | . For BBC and E|
00000040  6c 65 63 74 72 6f 6e 0d  00 28 20 20 f4 20 28 63  |lectron..(  . (c|
00000050  29 20 41 63 6f 72 6e 20  55 73 65 72 20 41 70 72  |) Acorn User Apr|
00000060  69 6c 20 31 39 38 35 0d  00 32 06 20 3a 0d 00 3c  |il 1985..2. :..<|
00000070  08 20 eb 20 36 0d 00 46  06 20 db 0d 00 50 15 20  |. . 6..F. ...P. |
00000080  f1 20 8a 33 2c 34 29 3b  c4 33 31 2c 22 2a 22 29  |. .3,4);.31,"*")|
00000090  0d 00 5a 1a 20 f1 20 8a  33 2c 35 29 3b 22 2a 22  |..Z. . .3,5);"*"|
000000a0  8a 33 33 2c 35 29 3b 22  2a 22 0d 00 64 30 20 f1  |.33,5);"*"..d0 .|
000000b0  20 8a 33 2c 36 29 3b 22  2a 22 8a 31 33 2c 36 29  | .3,6);"*".13,6)|
000000c0  3b 22 50 52 4f 43 5f 73  65 61 72 63 68 22 8a 33  |;"PROC_search".3|
000000d0  33 2c 36 29 3b 22 2a 22  20 20 0d 00 6e 1c 20 f1  |3,6);"*"  ..n. .|
000000e0  20 8a 33 2c 37 29 3b 22  2a 22 8a 33 33 2c 37 29  | .3,7);"*".33,7)|
000000f0  3b 22 2a 22 20 20 0d 00  78 15 20 f1 20 8a 33 2c  |;"*"  ..x. . .3,|
00000100  38 29 3b c4 33 31 2c 22  2a 22 29 0d 00 82 06 20  |8);.31,"*").... |
00000110  f1 0d 00 8c 30 20 f1 20  22 54 68 69 73 20 70 72  |....0 . "This pr|
00000120  6f 63 65 64 75 72 65 20  73 65 61 72 63 68 65 73  |ocedure searches|
00000130  20 66 6f 72 20 61 20 73  70 65 63 69 66 69 65 64  | for a specified|
00000140  22 0d 00 96 2e 20 f1 20  22 77 6f 72 64 20 6f 72  |".... . "word or|
00000150  20 73 65 72 69 65 73 20  6f 66 20 77 6f 72 64 73  | series of words|
00000160  20 69 6e 20 74 68 65 20  61 6e 73 77 65 72 22 0d  | in the answer".|
00000170  00 a0 31 20 f1 20 22 69  6e 70 75 74 74 65 64 20  |..1 . "inputted |
00000180  62 79 20 74 68 65 20 73  74 75 64 65 6e 74 2e 20  |by the student. |
00000190  49 74 20 69 67 6e 6f 72  65 73 20 61 6e 79 22 20  |It ignores any" |
000001a0  0d 00 aa 2b 20 f1 20 22  65 78 74 72 61 20 77 6f  |...+ . "extra wo|
000001b0  72 64 73 2c 20 73 70 65  6c 6c 69 6e 67 20 6d 69  |rds, spelling mi|
000001c0  73 74 61 6b 65 73 20 61  6e 64 22 0d 00 b4 2d 20  |stakes and"...- |
000001d0  f1 20 22 74 79 70 69 6e  67 20 65 72 72 6f 72 73  |. "typing errors|
000001e0  20 74 68 61 74 20 74 68  65 20 73 74 75 64 65 6e  | that the studen|
000001f0  74 20 6d 69 67 68 74 22  0d 00 be 0f 20 f1 20 22  |t might".... . "|
00000200  6d 61 6b 65 2e 22 20 0d  00 c8 06 20 f1 0d 00 d2  |make." .... ....|
00000210  2e 20 f1 20 22 57 68 61  74 20 66 6f 6c 6c 6f 77  |. . "What follow|
00000220  73 20 69 73 20 61 20 74  65 73 74 2d 64 72 69 76  |s is a test-driv|
00000230  65 20 70 72 6f 67 72 61  6d 2e 22 0d 00 dc 1e 20  |e program.".... |
00000240  f1 20 8a 30 2c 32 32 29  3b 22 50 72 65 73 73 20  |. .0,22);"Press |
00000250  61 6e 79 20 6b 65 79 2e  22 0d 00 e6 09 20 41 24  |any key.".... A$|
00000260  3d be 0d 00 f0 06 20 db  0d 00 fa 08 20 f5 20 20  |=..... ..... .  |
00000270  0d 01 04 28 20 f1 20 8a  30 2c 35 29 3b 22 57 4f  |...( . .0,5);"WO|
00000280  52 44 53 20 52 45 51 55  49 52 45 44 20 42 59 20  |RDS REQUIRED BY |
00000290  54 45 41 43 48 45 52 22  0d 01 0e 15 20 e8 20 8a  |TEACHER".... . .|
000002a0  30 2c 37 29 20 74 65 61  63 68 65 72 24 0d 01 18  |0,7) teacher$...|
000002b0  2f 20 f1 20 8a 30 2c 31  30 29 3b 22 53 54 55 44  |/ . .0,10);"STUD|
000002c0  45 4e 54 27 53 20 41 4e  53 57 45 52 20 54 4f 20  |ENT'S ANSWER TO |
000002d0  42 45 20 43 48 45 43 4b  45 44 22 20 0d 01 22 16  |BE CHECKED" ..".|
000002e0  20 e8 20 8a 30 2c 31 32  29 20 73 74 75 64 65 6e  | . .0,12) studen|
000002f0  74 24 0d 01 2c 21 20 f2  5f 73 65 61 72 63 68 28  |t$..,! ._search(|
00000300  73 74 75 64 65 6e 74 24  2c 74 65 61 63 68 65 72  |student$,teacher|
00000310  24 29 20 0d 01 36 60 20  e7 20 46 44 25 3d 31 20  |$) ..6` . FD%=1 |
00000320  8c 20 f1 20 8a 30 2c 31  35 29 3b 22 54 68 61 74  |. . .0,15);"That|
00000330  27 73 20 63 6f 72 72 65  63 74 2e 20 56 65 72 79  |'s correct. Very|
00000340  20 67 6f 6f 64 2e 22 20  8b 20 f1 20 8a 30 2c 31  | good." . . .0,1|
00000350  35 29 3b 22 53 6f 72 72  79 2c 20 62 75 74 20 74  |5);"Sorry, but t|
00000360  68 61 74 27 73 20 6e 6f  74 20 63 6f 72 72 65 63  |hat's not correc|
00000370  74 2e 22 0d 01 40 26 20  f1 20 8a 30 2c 31 38 29  |t."..@& . .0,18)|
00000380  3b 22 54 45 53 54 20 44  52 49 56 45 20 41 47 41  |;"TEST DRIVE AGA|
00000390  49 4e 20 28 59 2f 4e 29  22 0d 01 4a 0d 20 61 67  |IN (Y/N)"..J. ag|
000003a0  61 69 6e 24 3d be 0d 01  54 06 20 db 0d 01 5e 19  |ain$=...T. ...^.|
000003b0  20 f2 5f 73 65 61 72 63  68 28 61 67 61 69 6e 24  | ._search(again$|
000003c0  2c 22 4e 22 29 0d 01 68  0c 20 fd 20 46 44 25 3d  |,"N")..h. . FD%=|
000003d0  31 0d 01 72 06 20 e0 0d  01 7c 06 20 3a 0d 01 86  |1..r. ...|. :...|
000003e0  20 20 dd 20 f2 5f 73 65  61 72 63 68 28 72 65 70  |  . ._search(rep|
000003f0  6c 79 24 2c 61 6e 73 77  65 72 24 29 20 0d 01 90  |ly$,answer$) ...|
00000400  16 20 72 65 70 6c 79 24  3d 22 20 22 2b 72 65 70  |. reply$=" "+rep|
00000410  6c 79 24 0d 01 9a 3e 20  e7 20 72 65 70 6c 79 24  |ly$...> . reply$|
00000420  3d 22 20 22 20 8c 20 f1  20 22 59 6f 75 20 64 6f  |=" " . . "You do|
00000430  6e 27 74 20 73 65 65 6d  20 74 6f 20 68 61 76 65  |n't seem to have|
00000440  20 74 79 70 65 64 20 61  6e 79 74 68 69 6e 67 2e  | typed anything.|
00000450  22 0d 01 a4 1f 20 46 44  25 3d 30 3a 53 50 41 43  |".... FD%=0:SPAC|
00000460  45 25 3d 30 3a 4c 4b 25  3d 31 3a 52 25 3d 30 20  |E%=0:LK%=1:R%=0 |
00000470  0d 01 ae 22 20 f4 20 20  20 52 65 6d 6f 76 69 6e  |..." .   Removin|
00000480  67 20 61 6c 6c 20 62 75  74 20 74 68 65 20 62 61  |g all but the ba|
00000490  72 65 0d 01 b8 24 20 f4  20 20 20 65 73 73 65 6e  |re...$ .   essen|
000004a0  74 69 61 6c 73 20 66 72  6f 6d 20 74 68 65 20 61  |tials from the a|
000004b0  6e 73 77 65 72 24 0d 01  c2 1c 20 56 4f 57 45 4c  |nswer$.... VOWEL|
000004c0  24 3d 22 41 45 49 4f 55  59 48 61 65 69 6f 75 79  |$="AEIOUYHaeiouy|
000004d0  68 22 0d 01 cc 14 20 61  6e 24 3d c0 61 6e 73 77  |h".... an$=.answ|
000004e0  65 72 24 2c 31 29 0d 01  d6 17 20 e3 20 4e 3d 32  |er$,1).... . N=2|
000004f0  20 b8 20 a9 28 61 6e 73  77 65 72 24 29 0d 01 e0  | . .(answer$)...|
00000500  09 20 58 25 3d 30 0d 01  ea 39 20 e7 20 c1 61 6e  |. X%=0...9 . .an|
00000510  73 77 65 72 24 2c 4e 2d  31 2c 32 29 3d 22 53 43  |swer$,N-1,2)="SC|
00000520  22 20 84 20 c1 61 6e 73  77 65 72 24 2c 4e 2d 31  |" . .answer$,N-1|
00000530  2c 32 29 3d 22 73 63 22  20 8c 20 58 25 3d 31 0d  |,2)="sc" . X%=1.|
00000540  01 f4 2b 20 e7 20 c1 61  6e 73 77 65 72 24 2c 4e  |..+ . .answer$,N|
00000550  2c 31 29 3d c1 61 6e 73  77 65 72 24 2c 4e 2d 31  |,1)=.answer$,N-1|
00000560  2c 31 29 20 8c 20 58 25  3d 31 0d 01 fe 16 20 e3  |,1) . X%=1.... .|
00000570  20 59 3d 31 20 b8 20 a9  28 56 4f 57 45 4c 24 29  | Y=1 . .(VOWEL$)|
00000580  0d 02 08 28 20 e7 20 c1  61 6e 73 77 65 72 24 2c  |...( . .answer$,|
00000590  4e 2c 31 29 3d c1 56 4f  57 45 4c 24 2c 59 2c 31  |N,1)=.VOWEL$,Y,1|
000005a0  29 20 8c 20 58 25 3d 31  0d 02 12 0a 20 ed 20 59  |) . X%=1.... . Y|
000005b0  20 20 0d 02 1c 21 20 e7  20 c1 61 6e 73 77 65 72  |  ...! . .answer|
000005c0  24 2c 4e 2d 31 2c 31 29  3d 22 20 22 20 8c 20 58  |$,N-1,1)=" " . X|
000005d0  25 3d 30 0d 02 26 23 20  e7 20 58 25 3d 30 20 8c  |%=0..&# . X%=0 .|
000005e0  20 61 6e 24 3d 61 6e 24  2b c1 61 6e 73 77 65 72  | an$=an$+.answer|
000005f0  24 2c 4e 2c 31 29 0d 02  30 08 20 ed 20 4e 0d 02  |$,N,1)..0. . N..|
00000600  3a 1d 20 f4 20 20 20 20  43 68 65 63 6b 69 6e 67  |:. .    Checking|
00000610  20 74 68 65 20 72 65 70  6c 79 24 0d 02 44 06 20  | the reply$..D. |
00000620  f5 0d 02 4e 10 20 20 20  52 25 3d 52 25 2b 31 20  |...N.   R%=R%+1 |
00000630  20 0d 02 58 1c 20 20 20  41 61 73 63 25 3d 97 28  | ..X.   Aasc%=.(|
00000640  c1 61 6e 24 2c 4c 4b 25  2c 31 29 29 20 0d 02 62  |.an$,LK%,1)) ..b|
00000650  1d 20 20 20 52 61 73 63  25 3d 97 28 c1 72 65 70  |.   Rasc%=.(.rep|
00000660  6c 79 24 2c 52 25 2c 31  29 29 0d 02 6c 1f 20 20  |ly$,R%,1))..l.  |
00000670  20 e7 20 41 61 73 63 25  3d 33 32 20 8c 20 53 50  | . Aasc%=32 . SP|
00000680  41 43 45 25 3d 4c 4b 25  20 0d 02 76 22 20 20 20  |ACE%=LK% ..v"   |
00000690  e7 20 52 61 73 63 25 3e  39 36 20 8c 20 52 61 73  |. Rasc%>96 . Ras|
000006a0  63 25 3d 52 61 73 63 25  2d 33 32 0d 02 80 22 20  |c%=Rasc%-32..." |
000006b0  20 20 e7 20 41 61 73 63  25 3e 39 36 20 8c 20 41  |  . Aasc%>96 . A|
000006c0  61 73 63 25 3d 41 61 73  63 25 2d 33 32 0d 02 8a  |asc%=Aasc%-32...|
000006d0  1c 20 20 20 e7 20 41 61  73 63 25 3d 36 37 20 8c  |.   . Aasc%=67 .|
000006e0  20 41 61 73 63 25 3d 38  33 0d 02 94 1d 20 20 20  | Aasc%=83....   |
000006f0  e7 20 52 61 73 63 25 3d  36 37 20 8c 20 52 61 73  |. Rasc%=67 . Ras|
00000700  63 25 3d 38 33 20 0d 02  9e 2b 20 20 20 e7 20 52  |c%=83 ...+   . R|
00000710  61 73 63 25 3d 41 61 73  63 25 20 8c 20 f2 5f 66  |asc%=Aasc% . ._f|
00000720  6f 75 6e 64 20 8b 20 f2  5f 6e 6f 74 66 6f 75 6e  |ound . ._notfoun|
00000730  64 0d 02 a8 1c 20 fd 20  52 25 3d a9 28 72 65 70  |d.... . R%=.(rep|
00000740  6c 79 24 29 20 84 20 46  44 25 3d 31 20 0d 02 b2  |ly$) . FD%=1 ...|
00000750  09 20 e1 20 20 20 0d 02  bc 06 20 3a 0d 02 c6 12  |. .   .... :....|
00000760  20 dd 20 f2 5f 6e 6f 74  66 6f 75 6e 64 20 0d 02  | . ._notfound ..|
00000770  d0 1f 20 e7 20 52 61 73  63 25 3d 33 32 20 8c 20  |.. . Rasc%=32 . |
00000780  4c 4b 25 3d 53 50 41 43  45 25 2b 31 20 0d 02 da  |LK%=SPACE%+1 ...|
00000790  06 20 e1 0d 02 e4 06 20  3a 0d 02 ee 0f 20 dd 20  |. ..... :.... . |
000007a0  f2 5f 66 6f 75 6e 64 20  0d 02 f8 29 20 e7 20 4c  |._found ...) . L|
000007b0  4b 25 3d a9 28 61 6e 24  29 20 8c 20 46 44 25 3d  |K%=.(an$) . FD%=|
000007c0  31 20 8b 20 4c 4b 25 3d  4c 4b 25 2b 31 20 20 20  |1 . LK%=LK%+1   |
000007d0  20 0d 03 02 06 20 e1 0d  ff                       | .... ...|
000007d9
FORUM2.m0
FORUM2.m1
FORUM2.m2
FORUM2.m4
FORUM2.m5