home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1993 July / 1993-07.d64 / crypto (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  3KB  |  75 lines

  1. 100 rem copyright 1993 - compute publications intl ltd - all rights reserved
  2. 105 poke 53280,0:poke 53281,0:print"[147][158]"
  3. 110 print"        [195]ryptarithms  [211]olver
  4. 120 [153]"           by str$.(NULL)ankhurst
  5. 130 print
  6. 140 input "code string";x$
  7. 150 dim l(20):l=0:gosub350:pp=p:y$="1023456789"
  8. 160 for i=1 to len(y$):poke c-1+i,asc(mid$(y$,i,1)):next:poke cm,len(y$)-1
  9. 170 for i=1 to len(x$):poke 511+i,asc(mid$(x$,i,1)):next:poke i,0:sys 49155
  10. 174 for j=1 to i-1:if peek(511+j)then 178
  11. 176 print" embedded [194][193][211][201][195] function or command [146]":end
  12. 178 next:y=1
  13. 180 if peek(511+y)<>0 then y=y+1:goto 180
  14. 190 for k=1 to y-1:c=peek(511+k):c$=chr$(c):if c$<"a" or c$>"z" then250
  15. 200 if l=0 then230
  16. 210 y=-1:for i=0 to l-1:if l(i)=c then y=i
  17. 220 next:if y<>-1 then240
  18. 230 l(l)=c:y=l:l=l+1
  19. 240 poke pp,k:poke pp+1,y:pp=pp+2
  20. 250 next:poke pc,pp-p:for i=0 to l-1:poke x+i,i:next:poke mx,l-1
  21. 260 print"[147]";:f=0
  22. 270 print" "x$;:sys 49152
  23. 280 poke 198,0:y=peek(781)
  24. 290 if y=255 and f=0 then print:print"[145] sorry-no match [146]":goto340
  25. 300 if y=255 then print:print"[145] end of lists [146]":goto340
  26. 310 if y<>1 then330
  27. 320 f=f+1:print"  "int(ti/6)/10"seconds";:print:print" "x$;:sys 49158:goto280
  28. 330 if y=0 then print"  continue?";:wait 198,255:get y$:if y$="y"then270
  29. 340 print:print" finished at"int(ti/6)/10 "seconds":end
  30. 350 ti$="000000":ds=1984:if peek(44)<>18 then gosub 400
  31. 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
  32. 370 return
  33. 400 restore:for i=0 to-1 step-1:read y$:i=val(y$)=-1:next:x= 49152:data -1
  34. 410 read y:if y<>-2 then poke x,y:x=x+1:goto 410
  35. 420 return
  36. 430 data  24,144, 30, 76,  9,192, 56
  37. 440 data 176, 24,165,122, 72,165,123
  38. 450 data  72,169,  2,133,123,169,  0
  39. 460 data 133,122, 32,124,165,104,133
  40. 470 data 123,104,133,122, 96,173,  2
  41. 480 data 197,141,  0,197,165,122, 72
  42. 490 data 165,123, 72,176,  6, 32, 63
  43. 500 data 192, 76, 56,192, 32,137,192
  44. 510 data 104,133,123,104,133,122, 96
  45. 520 data 174,244,197,142, 69,198,206
  46. 530 data  69,198,174, 69,198,188,245
  47. 540 data 197,190,  3,197,189,164,197
  48. 550 data 206, 69,198,174, 69,198, 48
  49. 560 data  15,188,245,197,153,192,  7
  50. 570 data 153,255,  1,174, 69,198, 76
  51. 580 data  69,192,169,255,162,  1,133
  52. 590 data 122,134,123, 32,115,  0, 32
  53. 600 data 158,173,165, 97,240,  3,162
  54. 610 data   1, 96,165,197,201, 62,208
  55. 620 data   3,162,  0, 96,173,141,  2
  56. 630 data 201,  4,208, 17,169,  5,160
  57. 640 data 255,162,255,202,208,253,136
  58. 650 data 208,248,170,202,138,208,241
  59. 660 data 174,  0,197,188,  3,197,200
  60. 670 data 140,  1,197,174,163,197,169
  61. 680 data   0,157, 83,197,202, 16,250
  62. 690 data 174,  0,197,169,255,202, 48
  63. 700 data   9,188,  3,197,153, 83,197
  64. 710 data 202, 16,247,173,  1,197,205
  65. 720 data 163,197,240,  2,176, 48,172
  66. 730 data   1,197,185, 83,197,208, 12
  67. 740 data 174,  0,197,173,  1,197,157
  68. 750 data   3,197, 76,235,192,238,  1
  69. 760 data 197, 76,199,192,173,  0,197
  70. 770 data 205,  2,197,208,  3, 76, 63
  71. 780 data 192,238,  0,197,169,  0,141
  72. 790 data   1,197, 76,171,192,206,  0
  73. 800 data 197, 16,155,162,255, 96
  74. 810 data -2
  75.