home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 21 / 021.d81 / cryptogram (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  4KB  |  129 lines

  1. 5 gosub10000:  rem   title screen
  2. 10 dimc$(90):sr=0:poke56,100
  3. 12 bc=53281:co=54232:i=55296:pokebc,1
  4. 14 a=65:y=1064:g=y:h=y:z$="":k=30000:d=0:z=-1:m=k:f=y:r=1024
  5. 16 s=54272:forl=stos+24:pokel,0:next
  6. 18 v=s+24:pokev,15
  7. 20 wv=s+4: ad=s+5: sr=s+6: oc=1: dx=2
  8. 22 hf=s+1: lf=s: ps=s+2: p2=s+3
  9. 24 tw=16:rr=33:xx=128:yy=255:gosub194
  10. 26 fort=49152to49280:readrx:poket,rx:next
  11. 28 print"[147]"chr$(142)chr$(8)"would you like a random code?  y/n"
  12. 30 geta$:ifa$="y"then36
  13. 32 ifa$<>"n"then30
  14. 34 goto48
  15. 36 print,"   randomizing"
  16. 38 tp=89:x=26:dimf(90):fortt=65to90:f(tt)=tt:next
  17. 40 fort=65to90:rn=int(rnd(1)*x)+65
  18. 42 c$(a)=chr$(f(rn))
  19. 44 forty=rntotp:f(ty)=f(ty+1):next
  20. 46 tp=tp-1:x=x-1:a=a+1:next:goto72
  21. 48 print"[147][156]please type in your keyboard !symbol!"
  22. 50 print"for each letter of the alphabet"
  23. 52 fort=1to26:print,chr$(a);
  24. 54 input c$(a)
  25. 56 ifc$(a)=""thenprint"no blanks allowed:  redo":goto54
  26. 58 for check=a-1to65step-1
  27. 60 ifc$(a)=c$(ch)thenprint"symbol already used:  redo";:goto54
  28. 62 iflen(c$(a))>1thenc$(a)=left$(c$(a),1)
  29. 64 next:a=a+1:next
  30. 66 print"[147]     here is your completed code:"
  31. 68 fort=65to90:print,chr$(t)" = "c$(t);
  32. 70 next
  33. 72 print:print"   now type in the message you wish to"
  34. 74 print,"[157][157]encode.  (max:  6 lines)"
  35. 76 print,"[157][157]do not type return[146] until"
  36. 78 print,"message is complete"
  37. 80 print,"[157]press any key to start"
  38. 82 geta$:ifa$<>""thenprint"[147]":goto86
  39. 84 goto82
  40. 86 print"":fort=1to40:print"[192]";:next
  41. 88 print"      don't type below this line"
  42. 90 geta$:ifa$=""then90
  43. 92 ifa$<>chr$(13)thenprinta$"[164][157]";:g=g+1:goto90
  44. 94 print" [157] "
  45. 96 fort=ftog-1:pe=peek(t)
  46. 98 pokem,pe:m=m+1:next
  47. 100 input"  now press return to start game";a
  48. 102 print"[145]                                "
  49. 106 print"[147]":m=k:g=g-y
  50. 108 fort=1tog:n=peek(m)
  51. 109 ifn>26thenprintchr$(n)"[145][157]"chr$(n)"";:m=m+1:goto112
  52. 110 printc$(n+64);:m=m+1
  53. 112 d=d+1:ifd=40thenprint"";:d=0
  54. 114 next:tx=ti
  55. 115 gd$=""
  56. 116 printgd$"\ to check ";" * for hint ";
  57. 118 print" ^ to blank";
  58. 120 f=1024:cc=i:h=y:k=30000:m=k:print" change [146]  ";
  59. 121 print"               [157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]";
  60. 122 getz$:ifz$=""then122
  61. 123 ifz$=chr$(13)thenprint"(c/r) to  ";:goto126
  62. 124 ifz$="\"then146
  63. 125 printz$"  to  ";
  64. 126 getx$:ifx$=""then126
  65. 127 ifx$=chr$(13)thenprint"(c/r)";:z=asc(z$):x=asc(x$):goto130
  66. 128 printx$:z=asc(z$):x=asc(x$)
  67. 130 ifx=92then146
  68. 132 ifx=42 thengosub208
  69. 134 ifz<64thenz=z+64
  70. 136 ifx<64thenx=x+64
  71. 138 poke49408,z-64:poke49409,x-64
  72. 140 sys49152:goto116
  73. 146 print"","      checking [146]":e=0:forcr=0tog-1
  74. 148 ifpeek(e+r)<>peek(k)then184
  75. 150 e=e+1:ife=40thene=0:r=r+120
  76. 152 k=k+1:next
  77. 154 sr=100:tz=ti:tm=int((tz-tx)/3600)
  78. 155 tm=int((tz-tx)/3600):ts=int((tz-tx)/60)
  79. 156 print"[147]"," congratulations!  "cb$:oc=8:dx=1.6:gosub190
  80. 158 print"     you solved the cipher in "
  81. 159 print"      "tm"minutes and"ts"seconds."
  82. 160 print"   you get 100 points for solving it"
  83. 162 sc=30-tm
  84. 164 iftm>30then182
  85. 166 print" plus"sc*2"bonus points for solving it in"
  86. 168 print,"less than 30 minutes"
  87. 170 ifhn>0thenprint"  minus"10*hn"for the"hn"hint(s) you had"
  88. 172 print"       for a total of "sr+sc*2-hn*10" points"
  89. 174 print," play again?  y/n"
  90. 176 geta$:ifa$="y"thenclr:restore:goto10
  91. 178 ifa$<>"n"then176
  92. 180 load"hello connect",8:end
  93. 182 print"minus"sc"points for taking more than 30  minutes":goto170
  94. 184 fordl=1to500:next:print"","nope.  keep trying."
  95. 186 fort=1to2000:next
  96. 188 print,"[145]                   ":goto116
  97. 190 restore
  98. 192 tw=25: rr=65: xx=64: yy=138
  99. 194 pokead,xx:pokesr,yy:pokes+2,128:pokes+3,1
  100. 196 forsg=1totw
  101. 198 readaa,bb,dd:ee=(aa*256+bb)*oc:az=ee/256:ax=int(az):bx=(az-ax)*256
  102. 200 pokehf,ax:pokelf,bx:pokewv,rr
  103. 202 fort=1to130*(dd/dx):next:pokewv,rr-1
  104. 204 fort=1to25:next
  105. 206 next:fort=1to25-tw:readaa,bb,dd:next:return
  106. 208 tw=4:rr=17:xx=64:yy=138:hn=hn+1
  107. 210 print"[156]","hint number"hn
  108. 212 oc=32:restore:gosub194
  109. 214 print,"[145]               "
  110. 216 return
  111. 218 data 1,250,1,2,90,2,2,125,1,2,163,6,2,246,1,3,35,6,2,125,1,2,163,2
  112. 220 data 2,246,1,3,35,2,4, 48,1,3,244,2,2,163,1,3,35,1,3,244,1,3,187,14
  113. 222 data 3,134,.5,3,35,.5,2,163,.5,1,250,.5,2,90,8
  114. 224 data1,250,1,2,90,2,2,125,1,2,163,8
  115. 226 data 162,0,169,40,133,78,169,4,133,79,169,0,133,80,169,216,133,81
  116. 228 data 160,0,177,78,205,0,193,240,38,232,200,192,40,240,3,76,20,192
  117. 230 data 24,165,78,105,120,133,78,165,79,105,0,133,79,24,165,80,105,120
  118. 232 data 133,80,165,81,105,0,133,81,76,103,192,56,165,78,233,40,133,78
  119. 234 data 165,79,233,0,133,79,32,108,192,145,78,169,9,145,80,24,165,78
  120. 236 data 105,40,133,78,165,79,105,0,133,79,76,27,192,165,79,201,7,208
  121. 238 data 165,96,173,1,193,201,30,240,5,201,42,240,4,96,169,32,96
  122. 240 data 189,48,117,96
  123. 10000 rem   title screen
  124. 10002 poke53280,5:poke53281,1
  125. 10005 print"[147][144]"spc(10)"*** [195]ryptogram ***"
  126. 10010 print""spc(14)"[215]ritten by"
  127. 10015 print""spc(13)"[205]ark  [202]ordan"
  128. 10030 return
  129.