home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1993 July
/
1993-07.d64
/
crypto
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
3KB
|
75 lines
100 rem copyright 1993 - compute publications intl ltd - all rights reserved
105 poke 53280,0:poke 53281,0:print"[147][158]"
110 print" [195]ryptarithms [211]olver
120 [153]" by str$.(NULL)ankhurst
130 print
140 input "code string";x$
150 dim l(20):l=0:gosub350:pp=p:y$="1023456789"
160 for i=1 to len(y$):poke c-1+i,asc(mid$(y$,i,1)):next:poke cm,len(y$)-1
170 for i=1 to len(x$):poke 511+i,asc(mid$(x$,i,1)):next:poke i,0:sys 49155
174 for j=1 to i-1:if peek(511+j)then 178
176 print" embedded [194][193][211][201][195] function or command [146]":end
178 next:y=1
180 if peek(511+y)<>0 then y=y+1:goto 180
190 for k=1 to y-1:c=peek(511+k):c$=chr$(c):if c$<"a" or c$>"z" then250
200 if l=0 then230
210 y=-1:for i=0 to l-1:if l(i)=c then y=i
220 next:if y<>-1 then240
230 l(l)=c:y=l:l=l+1
240 poke pp,k:poke pp+1,y:pp=pp+2
250 next:poke pc,pp-p:for i=0 to l-1:poke x+i,i:next:poke mx,l-1
260 print"[147]";:f=0
270 print" "x$;:sys 49152
280 poke 198,0:y=peek(781)
290 if y=255 and f=0 then print:print"[145] sorry-no match [146]":goto340
300 if y=255 then print:print"[145] end of lists [146]":goto340
310 if y<>1 then330
320 f=f+1:print" "int(ti/6)/10"seconds";:print:print" "x$;:sys 49158:goto280
330 if y=0 then print" continue?";:wait 198,255:get y$:if y$="y"then270
340 print:print" finished at"int(ti/6)/10 "seconds":end
350 ti$="000000":ds=1984:if peek(44)<>18 then gosub 400
360 dx=50432:nx=dx+1:mx=nx+1:x=mx+1:t=x+80:cm=t+80:c=cm+1:pc=c+80:p=pc+1:r=p+80
370 return
400 restore:for i=0 to-1 step-1:read y$:i=val(y$)=-1:next:x= 49152:data -1
410 read y:if y<>-2 then poke x,y:x=x+1:goto 410
420 return
430 data 24,144, 30, 76, 9,192, 56
440 data 176, 24,165,122, 72,165,123
450 data 72,169, 2,133,123,169, 0
460 data 133,122, 32,124,165,104,133
470 data 123,104,133,122, 96,173, 2
480 data 197,141, 0,197,165,122, 72
490 data 165,123, 72,176, 6, 32, 63
500 data 192, 76, 56,192, 32,137,192
510 data 104,133,123,104,133,122, 96
520 data 174,244,197,142, 69,198,206
530 data 69,198,174, 69,198,188,245
540 data 197,190, 3,197,189,164,197
550 data 206, 69,198,174, 69,198, 48
560 data 15,188,245,197,153,192, 7
570 data 153,255, 1,174, 69,198, 76
580 data 69,192,169,255,162, 1,133
590 data 122,134,123, 32,115, 0, 32
600 data 158,173,165, 97,240, 3,162
610 data 1, 96,165,197,201, 62,208
620 data 3,162, 0, 96,173,141, 2
630 data 201, 4,208, 17,169, 5,160
640 data 255,162,255,202,208,253,136
650 data 208,248,170,202,138,208,241
660 data 174, 0,197,188, 3,197,200
670 data 140, 1,197,174,163,197,169
680 data 0,157, 83,197,202, 16,250
690 data 174, 0,197,169,255,202, 48
700 data 9,188, 3,197,153, 83,197
710 data 202, 16,247,173, 1,197,205
720 data 163,197,240, 2,176, 48,172
730 data 1,197,185, 83,197,208, 12
740 data 174, 0,197,173, 1,197,157
750 data 3,197, 76,235,192,238, 1
760 data 197, 76,199,192,173, 0,197
770 data 205, 2,197,208, 3, 76, 63
780 data 192,238, 0,197,169, 0,141
790 data 1,197, 76,171,192,206, 0
800 data 197, 16,155,162,255, 96
810 data -2