home *** CD-ROM | disk | FTP | other *** search
- 10 rem copyright 1994 - compute publications intl ltd - all rights reserved
- 20 rem word master by d. g. klich
- 30 poke53281,1:poke53280,0:open15,8,15:dimc$(500):print"[147]"spc(14)"[154]word master"
- 40 a$="[129]a tool for the":b$="crossword addict":printspc(21-len(a$)/2)a$:printspc(20-len(b$)/2)b$
- 50 print" choose a function:"
- 60 print" [159]1[146] = search for a word"
- 70 print" [159]2[146] = add new words to database"
- 80 print" [159]3[146] = delete a database word"
- 90 print" [159]4[146] = display a word file"
- 100 getn$:ifn$=""then100
- 110 n=val(n$):onngoto140,320,800,720
- 120 goto100
- 130 rem *****word search routine*****
- 140 print"[147]enter the word to be searched"
- 150 print"example: --l-o (hello)"
- 160 print"from 3 to 15 characters"
- 170 print"enter 'zzz' when ready to quit"
- 180 inputw$:ifw$="zzz"thenclose1:goto50
- 190 iflen(w$)<3then180
- 200 iflen(w$)>15then180
- 210 l=len(w$):open1,8,2,"0:words"+str$(l)+",s,r":input#1,x$
- 220 fori=1tol
- 230 ifmid$(w$,i,1)="-"then270
- 240 ifmid$(w$,i,1)=mid$(x$,i,1)thens=1:goto270
- 250 s=0:input#1,x$:ifx$="zzz"then300
- 260 goto220
- 270 next
- 280 ifs=1thenprintx$,
- 290 goto250
- 300 close1:print:print"end of word search":goto170
- 310 rem *****add words routine*****
- 320 m=0:n=0:o$=""
- 330 print"[147]enter the list of words to be added to"
- 340 print" the databases."
- 350 print"from 3 to 15 characters"
- 360 print"enter 'zzz' at end of list":c=1
- 370 inputx$:ifx$="zzz"then420
- 380 iflen(x$)<3then370
- 390 iflen(x$)>15then370
- 400 ifright$(x$,1)<"a"then370
- 410 c$(c)=str$(len(x$))+x$:c=c+1:ifc<>500then370
- 420 l=c-1:ifl=1then470
- 430 ifl=0then50
- 440 forp=1tol-1:s$="zzz":s=0
- 450 fori=ptol:ifc$(i)<s$thens$=c$(i):s=i
- 460 nexti:h$=c$(p):c$(p)=s$:c$(s)=h$:nextp
- 470 forc=1tol
- 480 ifc$(c)=c$(c-1)then610
- 490 fori=1to5:ifmid$(c$(c),i,1)<"a"thennexti
- 500 n$=left$(c$(c),i-1):w$=mid$(c$(c),i)
- 510 ifn$=o$then540
- 520 ifo$<>""thengosub680
- 530 open1,8,2,"0:words"+n$+",s,r":open2,8,3,"0:work,s,w":input#1,x$:o$=n$
- 540 ifw$<x$thenprint#2,w$:m=m+1:goto610
- 550 ifw$=x$then590
- 560 print#2,x$
- 570 input#1,x$:ifx$<>"zzz"then540
- 580 forq=1toval(n$)-3:x$=x$+"z":nextq:goto540
- 590 print#2,w$
- 600 input#1,x$:ifx$="zzz"thenforq=1toval(n$)-3:x$=x$+"z":nextq
- 610 gosub680
- 620 print" words entered ";l
- 630 print" words accepted ";m
- 640 print" duplicates ";l-m
- 650 print" files passed ";n
- 660 print"updating of files completed":goto50
- 670 rem*****finish input copy and close*****
- 680 ifleft$(x$,3)="zzz"then700
- 690 print#2,x$:input#1,x$:ifx$<>"zzz"then690
- 700 print#2,"zzz":close1:close2:print#15,"s0:words"+o$:print#15,"r0:words"+o$+"=work":n=n+1:return
- 710 rem *****dump a word file*****
- 720 input"[147] enter length of words";x:w=0
- 730 ifx<3then50
- 740 ifx>15then50
- 750 close1:open1,8,2,"0:words"+str$(x)+",s,r":y=x+1
- 760 input#1,z$:printz$;"[160]";:y=y+x+1:ify>40thenprint:y=x+1
- 770 ifz$="zzz"thenclose1:print:print"number of words ";w:goto50
- 780 w=w+1:goto760
- 790 rem *****delete a word*****
- 800 h=0:print"[147]enter the word to be deleted":inputw$:ifw$="zzz"then50
- 810 l=len(w$):open1,8,2,"0:words"+str$(l)+",s,r":open2,8,3,"0:work,s,w"
- 820 input#1,x$:ifx$="zzz"then870
- 830 ifw$>x$thenprint#2,x$:goto820
- 840 ifw$=x$thenh=1:goto820
- 850 ifh<>1thenprint"the word ";w$;"[146] was not found":close1:close2:print#15,"s0:work":goto50
- 860 print"";w$;"[146] has been deleted":w$="":forq=1tol:w$=w$+"z":next:goto830
- 870 print#2,"zzz":close1:close2:print#15,"s0:words"+str$(l):print#15,"r0:words"+str$(l)+"=work":goto50
-