Home » Archimedes archive » Acorn User » AU 1998-06 A.adf » Regulars » StarInfo/Nonsense/ImpSpell

StarInfo/Nonsense/ImpSpell

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 » Archimedes archive » Acorn User » AU 1998-06 A.adf » Regulars
Filename: StarInfo/Nonsense/ImpSpell
Read OK:
File size: 0428 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM     >ImpSpell
   20REM     Simple ImpressionSpell demo
   30REM By  DCA, based on info by Paul Burns
   40REM For 32-bit machines
   50REM (c) BAU December 1993
   60:
   80SYS "Spell_ImpressionInfo" TO ,words
   90PRINT"Dictionary contains ";words;" words"'
  100FOR i%=1 TO 10
  110 r%=RND(words)
  120 PRINT"Word number ";r%;" is ";FNget_word(r%)
  130NEXT
  140PRINT
  150PROCsearch_for("AARDVARK")
  160PROCsearch_for("ACORN")
  170PROCsearch_for("CORRECT")
  180PROCsearch_for("RONG")
  190PRINT
  200FOR i%=1 TO 26
  210 PRINTCHR$(i%+ASC"A"-1)"s start at ";FNfind_word(CHR$(i%+ASC"A"-1)),;
  220NEXT
  230PRINT''
  240END
  250:
  260DEF PROCsearch_for(word$)
  270LOCAL n%
  280PRINT"Word '"word$"'";TAB(15);": ";
  290n%=FNenum_word(word$)
  300IF n%<>-1 THEN
  310 PRINT"found - number ";n%
  320ELSE
  330 PRINT"not found"
  340ENDIF
  350ENDPROC
  360:
  370DEF FNenum_word(word$)
  380LOCAL n%
  390SYS "XSpell_EnumWord",word$+CHR$0 TO ,n%;ok%
  400IF (ok% AND 1)>0 THEN n%=-1
  410=n%
  420:
  430DEF FNfind_word(word$)
  440LOCAL n%
  450SYS "Spell_FindWord",word$+CHR$0 TO n%
  460=n%
  470:
  480DEF FNget_word(word_no%)
  490LOCAL addr%
  500SYS "Spell_GetWord",word_no% TO ,addr%
  510=FNget_str(addr%)
  520:
  530DEF FNget_str(a%)
  540LOCAL a$
  550a$=""
  560WHILE ?a%>=32
  570 a$+=CHR$?a%
  580 a%+=1
  590ENDWHILE
  600=a$

�     >ImpSpell
%�     Simple ImpressionSpell demo
*� By  DCA, based on info by Paul Burns
(� For 32-bit machines
2� (c) BAU December 1993
<:
P&ș "Spell_ImpressionInfo" � ,words
Z+�"Dictionary contains ";words;" words"'
d� i%=1 � 10
n r%=�(words)
x, �"Word number ";r%;" is ";�get_word(r%)
��
��
��search_for("AARDVARK")
��search_for("ACORN")
��search_for("CORRECT")
��search_for("RONG")
��
�� i%=1 � 26
�: �(i%+�"A"-1)"s start at ";�find_word(�(i%+�"A"-1)),;
��
��''
��
�:
� �search_for(word$)
� n%
 �"Word '"word$"'";�15);": ";
"n%=�enum_word(word$)
,� n%<>-1 �
6 �"found - number ";n%
@�
J �"not found"
T�
^�
h:
r� �enum_word(word$)
|� n%
�+ș "XSpell_EnumWord",word$+�0 � ,n%;ok%
�� (ok% � 1)>0 � n%=-1
�=n%
�:
�� �find_word(word$)
�� n%
�%ș "Spell_FindWord",word$+�0 � n%
�=n%
�:
�� �get_word(word_no%)
�� addr%
�(ș "Spell_GetWord",word_no% � ,addr%
�=�get_str(addr%)
:
� �get_str(a%)
� a$
&	a$=""
0ȕ ?a%>=32
:
 a$+=�?a%
D
 a%+=1
N�
X=a$
�
00000000  0d 00 0a 13 f4 20 20 20  20 20 3e 49 6d 70 53 70  |.....     >ImpSp|
00000010  65 6c 6c 0d 00 14 25 f4  20 20 20 20 20 53 69 6d  |ell...%.     Sim|
00000020  70 6c 65 20 49 6d 70 72  65 73 73 69 6f 6e 53 70  |ple ImpressionSp|
00000030  65 6c 6c 20 64 65 6d 6f  0d 00 1e 2a f4 20 42 79  |ell demo...*. By|
00000040  20 20 44 43 41 2c 20 62  61 73 65 64 20 6f 6e 20  |  DCA, based on |
00000050  69 6e 66 6f 20 62 79 20  50 61 75 6c 20 42 75 72  |info by Paul Bur|
00000060  6e 73 0d 00 28 19 f4 20  46 6f 72 20 33 32 2d 62  |ns..(.. For 32-b|
00000070  69 74 20 6d 61 63 68 69  6e 65 73 0d 00 32 1b f4  |it machines..2..|
00000080  20 28 63 29 20 42 41 55  20 44 65 63 65 6d 62 65  | (c) BAU Decembe|
00000090  72 20 31 39 39 33 0d 00  3c 05 3a 0d 00 50 26 c8  |r 1993..<.:..P&.|
000000a0  99 20 22 53 70 65 6c 6c  5f 49 6d 70 72 65 73 73  |. "Spell_Impress|
000000b0  69 6f 6e 49 6e 66 6f 22  20 b8 20 2c 77 6f 72 64  |ionInfo" . ,word|
000000c0  73 0d 00 5a 2b f1 22 44  69 63 74 69 6f 6e 61 72  |s..Z+."Dictionar|
000000d0  79 20 63 6f 6e 74 61 69  6e 73 20 22 3b 77 6f 72  |y contains ";wor|
000000e0  64 73 3b 22 20 77 6f 72  64 73 22 27 0d 00 64 0f  |ds;" words"'..d.|
000000f0  e3 20 69 25 3d 31 20 b8  20 31 30 0d 00 6e 10 20  |. i%=1 . 10..n. |
00000100  72 25 3d b3 28 77 6f 72  64 73 29 0d 00 78 2c 20  |r%=.(words)..x, |
00000110  f1 22 57 6f 72 64 20 6e  75 6d 62 65 72 20 22 3b  |."Word number ";|
00000120  72 25 3b 22 20 69 73 20  22 3b a4 67 65 74 5f 77  |r%;" is ";.get_w|
00000130  6f 72 64 28 72 25 29 0d  00 82 05 ed 0d 00 8c 05  |ord(r%).........|
00000140  f1 0d 00 96 1b f2 73 65  61 72 63 68 5f 66 6f 72  |......search_for|
00000150  28 22 41 41 52 44 56 41  52 4b 22 29 0d 00 a0 18  |("AARDVARK")....|
00000160  f2 73 65 61 72 63 68 5f  66 6f 72 28 22 41 43 4f  |.search_for("ACO|
00000170  52 4e 22 29 0d 00 aa 1a  f2 73 65 61 72 63 68 5f  |RN").....search_|
00000180  66 6f 72 28 22 43 4f 52  52 45 43 54 22 29 0d 00  |for("CORRECT")..|
00000190  b4 17 f2 73 65 61 72 63  68 5f 66 6f 72 28 22 52  |...search_for("R|
000001a0  4f 4e 47 22 29 0d 00 be  05 f1 0d 00 c8 0f e3 20  |ONG").......... |
000001b0  69 25 3d 31 20 b8 20 32  36 0d 00 d2 3a 20 f1 bd  |i%=1 . 26...: ..|
000001c0  28 69 25 2b 97 22 41 22  2d 31 29 22 73 20 73 74  |(i%+."A"-1)"s st|
000001d0  61 72 74 20 61 74 20 22  3b a4 66 69 6e 64 5f 77  |art at ";.find_w|
000001e0  6f 72 64 28 bd 28 69 25  2b 97 22 41 22 2d 31 29  |ord(.(i%+."A"-1)|
000001f0  29 2c 3b 0d 00 dc 05 ed  0d 00 e6 07 f1 27 27 0d  |),;..........''.|
00000200  00 f0 05 e0 0d 00 fa 05  3a 0d 01 04 18 dd 20 f2  |........:..... .|
00000210  73 65 61 72 63 68 5f 66  6f 72 28 77 6f 72 64 24  |search_for(word$|
00000220  29 0d 01 0e 08 ea 20 6e  25 0d 01 18 20 f1 22 57  |)..... n%... ."W|
00000230  6f 72 64 20 27 22 77 6f  72 64 24 22 27 22 3b 8a  |ord '"word$"'";.|
00000240  31 35 29 3b 22 3a 20 22  3b 0d 01 22 18 6e 25 3d  |15);": ";..".n%=|
00000250  a4 65 6e 75 6d 5f 77 6f  72 64 28 77 6f 72 64 24  |.enum_word(word$|
00000260  29 0d 01 2c 0e e7 20 6e  25 3c 3e 2d 31 20 8c 0d  |)..,.. n%<>-1 ..|
00000270  01 36 1a 20 f1 22 66 6f  75 6e 64 20 2d 20 6e 75  |.6. ."found - nu|
00000280  6d 62 65 72 20 22 3b 6e  25 0d 01 40 05 cc 0d 01  |mber ";n%..@....|
00000290  4a 11 20 f1 22 6e 6f 74  20 66 6f 75 6e 64 22 0d  |J. ."not found".|
000002a0  01 54 05 cd 0d 01 5e 05  e1 0d 01 68 05 3a 0d 01  |.T....^....h.:..|
000002b0  72 17 dd 20 a4 65 6e 75  6d 5f 77 6f 72 64 28 77  |r.. .enum_word(w|
000002c0  6f 72 64 24 29 0d 01 7c  08 ea 20 6e 25 0d 01 86  |ord$)..|.. n%...|
000002d0  2b c8 99 20 22 58 53 70  65 6c 6c 5f 45 6e 75 6d  |+.. "XSpell_Enum|
000002e0  57 6f 72 64 22 2c 77 6f  72 64 24 2b bd 30 20 b8  |Word",word$+.0 .|
000002f0  20 2c 6e 25 3b 6f 6b 25  0d 01 90 19 e7 20 28 6f  | ,n%;ok%..... (o|
00000300  6b 25 20 80 20 31 29 3e  30 20 8c 20 6e 25 3d 2d  |k% . 1)>0 . n%=-|
00000310  31 0d 01 9a 07 3d 6e 25  0d 01 a4 05 3a 0d 01 ae  |1....=n%....:...|
00000320  17 dd 20 a4 66 69 6e 64  5f 77 6f 72 64 28 77 6f  |.. .find_word(wo|
00000330  72 64 24 29 0d 01 b8 08  ea 20 6e 25 0d 01 c2 25  |rd$)..... n%...%|
00000340  c8 99 20 22 53 70 65 6c  6c 5f 46 69 6e 64 57 6f  |.. "Spell_FindWo|
00000350  72 64 22 2c 77 6f 72 64  24 2b bd 30 20 b8 20 6e  |rd",word$+.0 . n|
00000360  25 0d 01 cc 07 3d 6e 25  0d 01 d6 05 3a 0d 01 e0  |%....=n%....:...|
00000370  19 dd 20 a4 67 65 74 5f  77 6f 72 64 28 77 6f 72  |.. .get_word(wor|
00000380  64 5f 6e 6f 25 29 0d 01  ea 0b ea 20 61 64 64 72  |d_no%)..... addr|
00000390  25 0d 01 f4 28 c8 99 20  22 53 70 65 6c 6c 5f 47  |%...(.. "Spell_G|
000003a0  65 74 57 6f 72 64 22 2c  77 6f 72 64 5f 6e 6f 25  |etWord",word_no%|
000003b0  20 b8 20 2c 61 64 64 72  25 0d 01 fe 14 3d a4 67  | . ,addr%....=.g|
000003c0  65 74 5f 73 74 72 28 61  64 64 72 25 29 0d 02 08  |et_str(addr%)...|
000003d0  05 3a 0d 02 12 12 dd 20  a4 67 65 74 5f 73 74 72  |.:..... .get_str|
000003e0  28 61 25 29 0d 02 1c 08  ea 20 61 24 0d 02 26 09  |(a%)..... a$..&.|
000003f0  61 24 3d 22 22 0d 02 30  0e c8 95 20 3f 61 25 3e  |a$=""..0... ?a%>|
00000400  3d 33 32 0d 02 3a 0d 20  61 24 2b 3d bd 3f 61 25  |=32..:. a$+=.?a%|
00000410  0d 02 44 0a 20 61 25 2b  3d 31 0d 02 4e 05 ce 0d  |..D. a%+=1..N...|
00000420  02 58 07 3d 61 24 0d ff                           |.X.=a$..|
00000428