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

  1. 5 poke 53280,0:poke 53281,0:print"[147][155]please wait..."
  2. 10 s=54272
  3. 20 open 1,8,8,"scrambler highs,s,w":close 1:open 1,8,15:input#1,a,b$
  4. 30 if b$<>"file exists" then close 1:gosub 1880
  5. 40 close 1
  6. 50 dim w$(200)
  7. 60 dim dc$(13),al(26)
  8. 70 for i=1 to 13:read dc$(i):next i
  9. 80 poke 53280,0:poke 53281,0:print"[147]"
  10. 90 gosub 1950
  11. 100 print"[158][213][195][195][203]     [155][213][195][195][201]     [156][213][201][213][201]   ";
  12. 110 print"  [150][201]        [153][213][195][195][201][158][202][195][195][201]     [155][171]";
  13. 120 print"C[178]K     [156]BJKB     [150]B       ";
  14. 130 print" [153][171][195][178][203][158][213][195][195][203][213][195][195][201] [155][203] [202][203][213][195][195][201] [156][203] ";
  15. 140 print" J [176]CCI[150][173]CCI[159]UCCK [153]K JK    B";
  16. 150 print"        [171]CC[179]      [171]CC[179]   ";
  17. 160 print" [159][171]C           JCCK     K ";
  18. 170 print" [202]      [173][195][195][203]    [159][202][195][195][201]     ";
  19. 180 gosub 1950
  20. 190 printspc(4)"[152][213][196][201] copyright 1988"
  21. 200 printspc(4)"[199]c[200] compute! publications inc."
  22. 210 printspc(4)"[202][198][203] all rights reserved"
  23. 220 printspc(3)"number of players (1 - 4)  1[157][157][157]";:input np
  24. 230 if np<1 or np>4 then print"[145][145]":goto220
  25. 240 for i=1 to np
  26. 250 printspc(3)"player";i;", your name                [157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]";
  27. 260 input p$(i)
  28. 270 if p$(i)="" then p$(i)="player "+str$(i)
  29. 280 if len(p$(i))>10 then p$(i)=left$(p$(i),10)
  30. 290 print"[145][145]";:next i
  31. 300 printspc(3)"game type-words, points (w,p)? ";
  32. 310 get a$
  33. 320 if a$<>"w" and a$<>"p" then print"[145][145]":goto 300
  34. 330 print a$:gt$=a$
  35. 340 printspc(3)"timer length (1,3,5,7)  3[157][157][157]";:input tl$
  36. 350 if tl$<>"1" and tl$<>"3" and tl$<>"5" and tl$<>"7" then print"[145][145]";:goto 340
  37. 360 tl=val(tl$)
  38. 370 sp$="                                      "
  39. 380 v0$=chr$(0)
  40. 390 for pl=1 to np
  41. 400 tm=tl*600:nm=0:sc=0
  42. 410 gosub 1350
  43. 420 print"[147]"
  44. 430 poke 53280,12:poke 53281,0:poke 646,12
  45. 440 for d=55296 to 55303:poke d,11:poke d+32,11
  46. 450 poke d-54272,160:poke d-54240,160:next
  47. 460 for m=56256 to 56295:poke m,11:next:for m=56274 to 56276:poke m,6:next m
  48. 470 for m=56285 to 56294:poke m,6:next m
  49. 480 ford=55296 to 56256 step 40:poke d,11:poke d+39,11:poke d-54272,160
  50. 490 poke d-54233,160:next
  51. 500 for d=1984 to 2017:poke d,160:next
  52. 510 for d=2019 to 2022:poke d,48:next
  53. 520 for m=0 to 5:poke 2013+m,asc(mid$("score"+chr$(122),m+1,1))-64:next m
  54. 530 print"":for x=1 to 23:print"";:next
  55. 540 print""p$(pl)"";
  56. 550 for x=1 to 8:print"";:next
  57. 560 for x=1 to pl
  58. 570 if x>1 then printspc(9)p$(x-1);"'s score was ";sc(x-1);"":poke 198,0
  59. 580 next x
  60. 590 print"":printspc(5)"    press any key to start    "
  61. 600 gosub 1930
  62. 610 gosub 1860
  63. 620 print"[151]       [152] ";
  64. 630 for i=1 to 13:print mid$(ps$,i,1);" ";:next i
  65. 640 for i=1 to 26:poke 49152+i,0:next i
  66. 650 for i=1 to 13
  67. 660 n=asc(mid$(ps$,i,1))-64
  68. 670 poke 49152+n,peek(49152+n)+1
  69. 680 next i:print:print:print"";
  70. 690 print"";
  71. 700 nm=nm+1:wd$=""
  72. 710 print nm;
  73. 720 for i=49153 to 49178:poke 100+i,peek(i):next i
  74. 730 print"[155][175][157]";
  75. 740 get a$:tm=tm-.6:if ss<>int(tm/10) then ss=int(tm/10):gosub 1690
  76. 750 if ss<=0 then gosub 1570:gosub 1630:goto 940
  77. 760 if int(ss)=20 then poke 53280,2
  78. 770 if a$=chr$(20) then if wd$<>"" then print" [157][157] [157][175][157]";:gosub 1660
  79. 780 if a$=chr$(13) then 870
  80. 790 if a$<"a" or a$>"z" then 740
  81. 800 tm=tm-2
  82. 810 a=asc(a$)+49188:if peek(a)=0 then 740
  83. 820 gosub 1510
  84. 830 print a$;
  85. 840 wd$=wd$+a$
  86. 850 poke a,peek(a)-1
  87. 860 goto 730
  88. 870 if wd$="" then 790
  89. 880 fl=1:if nm=1 then 910
  90. 890 for i=1 to nm-1:if wd$=w$(i) then fl=0
  91. 900 next i
  92. 910 if fl=1 then w$(nm)=wd$:gosub 1570:gosub 1390:goto 690
  93. 920 for i=1 to 2+len(wd$+str$(nm)):print" [157][157]";:next i:nm=nm-1
  94. 930 gosub 1630:print"";:goto 690
  95. 940 sc(pl)=sc:poke 53280,12:print:print"any deletions?"
  96. 950 gosub 1930
  97. 960 if a$="n" then 990
  98. 970 if a$<>"y" then 950
  99. 980 gosub 1730
  100. 990 next pl
  101. 1000 print"[147]":print:if np=1 then 1070
  102. 1010 print"the scores:":print
  103. 1020 hs=0:for i=1 to np:print p$(i),sc(i)
  104. 1030 if sc(i)>hs then wn=i:hs=sc(i)
  105. 1040 next i:print
  106. 1050 print"the winner is ";p$(wn)
  107. 1060 goto 1080
  108. 1070 print"[147]your score is ";sc(1):hs=sc(1):print""
  109. 1080 open 1,8,2,"scrambler highs,s,r":for i=1 to 4:for j=1 to 2:input#1,hs(i,j)
  110. 1090 next j:next i:close 1
  111. 1100 i=int(tl/2)+1:j=(0-(gt$="w"))+1
  112. 1110 if hs>hs(i,j) then hs(i,j)=hs:gosub 1880
  113. 1120 print"high scores:"
  114. 1130 print:print"","points","words":print"[196][196][196][196][196][196][196][196][196][196][196]"
  115. 1140 for i=1 to 4:print i*2-1,;:print"[157][157][157][157][157][157][157]min.   ";:for j=1 to 2
  116. 1150 print hs(i,j),:nextj:print:next i
  117. 1160 print"play again? same / new / quit"
  118. 1170 gosub 1930
  119. 1180 if a$="s" then 390
  120. 1190 if a$="n" then goto 80
  121. 1200 if a$="q" then print"[147]":end
  122. 1210 goto 1170
  123. 1220 data bowyol
  124. 1230 data tikrbh
  125. 1240 data aeaeae
  126. 1250 data fplhbn
  127. 1260 data finutp
  128. 1270 data ocompw
  129. 1280 data vqysws
  130. 1290 data pqvwai
  131. 1300 data sihruf
  132. 1310 data kdgjmc
  133. 1320 data eaeaea
  134. 1330 data zqxevj
  135. 1340 data sumrgi
  136. 1350 ps$=""
  137. 1360 for i=1 to 13:ps$=ps$+mid$(dc$(i),int(rnd(0)*6+1),1)
  138. 1370 next i
  139. 1380 return
  140. 1390 print" ";:poke 783,1:sys 65520
  141. 1400 if peek(782)>28 then print:print"";:poke 783,1:sys 65520
  142. 1410 if peek(781)>22 then gosub 1860:print"";
  143. 1420 nl=len(wd$):if nl>5 then nl=6
  144. 1430 nl=nl-(nl>3)-(nl>4)-(nl>5)
  145. 1440 if gt$="p" then sc=sc+nl
  146. 1450 if gt$="w" then sc=sc+1
  147. 1460 sc$=str$(sc)
  148. 1470 sc$=right$(sc$,len(sc$)-1)
  149. 1480 if len(sc$)<4 then sc$="0"+sc$:goto 1480
  150. 1490 for i=1 to len(sc$):poke 2018+i,asc(mid$(sc$,i,1)):next i
  151. 1500 return
  152. 1510 poke s+24,11
  153. 1520 poke s+3,8:poke s+5,0:poke s+6,240
  154. 1530 poke s,47:poke s+1,65
  155. 1540 poke s+4,65
  156. 1550 poke s+4,64:poke s+24,0
  157. 1560 return
  158. 1570 poke s+24,11
  159. 1580 poke s+1,130
  160. 1590 poke s+5,9:poke s+15,30
  161. 1600 poke s+4,21
  162. 1610 for t=1to 75:next:poke s+4,20
  163. 1620 poke 54273,0:poke 54272,0:return
  164. 1630 poke s+24,10:poke s+5,128:poke s+6,248
  165. 1640 poke s+1,5:poke s+4,33:for b3=1 to 119:next:poke s+1,0:poke s+24,0
  166. 1650 poke 54273,0:poke 54272,0:return
  167. 1660 a=asc(right$(wd$,1))-64:poke 49252+a,peek(49252+a)+1
  168. 1670 wd$=left$(wd$,len(wd$)-1)
  169. 1680 return
  170. 1690 ss$=str$(ss):ss$=right$(ss$,len(ss$)-1)
  171. 1700 if len(ss$)<3 then ss$=" "+ss$:goto 1700
  172. 1710 for i=1 to 3:poke 2001+i,asc(mid$(ss$,i,1)):next i
  173. 1720 return
  174. 1730 gosub 1860
  175. 1740 sc=sc(pl)
  176. 1750 for i=1 to nm-1:print"";w$(i);"         "
  177. 1760 print"is this word correct? (y/n)"
  178. 1770 gosub 1930
  179. 1780 if a$="n" then wd$=w$(i):gosub 1810
  180. 1790 next i:sc(pl)=sc
  181. 1800 return
  182. 1810 nl=len(wd$):if nl>5 then nl=6
  183. 1820 nl=nl-(nl>3)-(nl>4)-(nl>5)
  184. 1830 if gt$="p" then sc=sc-nl
  185. 1840 if gt$="w" then sc=sc-1
  186. 1850 return
  187. 1860 print"":fori=1to22:print"                                      ":nexti
  188. 1870 return
  189. 1880 open1,8,15,"s0:scrambler highs":close 1
  190. 1890 print"writing new hi score"
  191. 1900 open 1,8,8,"scrambler highs,s,w":for i=1 to 4:for j=1 to 2:print#1,hs(i,j)
  192. 1910 next j:next i
  193. 1920 close 1:open 1,8,15:input#1,a,b$:close 1:return
  194. 1930 get a$:if a$="" then 1930
  195. 1940 return
  196. 1950 for d=1 to 40:print"[195]";:next
  197. 1960 return
  198.