home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1991 September / 1991-09.d64 / showdown (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  3KB  |  130 lines

  1. 0 clr
  2. 10 rem copyright 1991 - compute publications intl ltd - all rights reserved
  3. 100 dimf(2000),g(2000)
  4. 110 gosub 880
  5. 120 gosub1000
  6. 130 s = 1475:o=1274:b=1391:c=1397:m=0:w=0:f=0:g=0:u=0
  7. 140 print"[147][144]":poke 53280,12:poke53281,12
  8. 150 print"    [157] [157] [157][157][157][157][157] [145][157] [145][157] "
  9. 160 print"   [146][215][215][215]   [146][145][157][157][157][157][157][157][215][215][215]"
  10. 170 print" [157] [157] [157]   [146][215][215][146][215]   [145][157] [145][157] [145][157] [157][157][157][157][157][157][157][157][146]";
  11. 180 print"[215][215][215][215][215][215][215][157][157][157][157][157][157][157][215][215][215] [215][215][215]"
  12. 190 print"[215][215][215][215][215][215][215]"
  13. 200 print" [146][215][215][215] [146]"
  14. 210 print"     "
  15. 220 ifh=-1then 1190
  16. 230 v=2
  17. 240 ifv=3then v=1
  18. 250 ifi=0thenv=2
  19. 260 jo=usr(v):geta$
  20. 270 if(joand15)=1thenw=-40:goto480
  21. 280 if(joand15)=4thenw=-1:goto480
  22. 290 if(joand15)=8thenw=1:goto480
  23. 300 if(joand15)=2thenw=40:goto480
  24. 310 if(joand16)=0then goto340
  25. 320 if a$ ="@" then 610
  26. 330 goto 240
  27. 340 jo=usr(v):if(joand15)=0then goto340
  28. 350 if(joand15)=1thenw=-40:goto400
  29. 360 if(joand15)=4thenw=-1:goto400
  30. 370 if(joand15)=8thenw=1:goto400
  31. 380 if(joand15)=2thenw=40:goto400
  32. 390 goto 240
  33. 400 y=s+w:r=0:if peek(s)=215then r=r+1
  34. 410 ifpeek(y)=87thenr=r+1
  35. 420 ifpeek(s+w+w)=32thenr=r+1
  36. 430 ifr=3 then 450
  37. 440 goto 530
  38. 450 m=m+1:pokes,32:pokes+w,32:gosub560:poke s+w+w,215:s=s+w+w:v=v+1:u=u+1
  39. 460 f(u)=1:g(u)=w
  40. 470 goto 240
  41. 480 j=0:z=peek(s):y=s+w :ifpeek(y)=87thenq=87:j=j+1
  42. 490 ifpeek(y)=32thenq=32:j=j+1
  43. 500 if j=1 then 520
  44. 510 gosub 530
  45. 520 pokes,z-128:pokes+w,q+128:s=s+w:u=u+1:f(u)=0:g(u)=w:goto 240
  46. 530 print"illegal move":gosub 560
  47. 540 print"            "
  48. 550 goto  240
  49. 560 rem
  50. 570 poke54296,15:poke54277,64:poke54273,162:poke54272,37
  51. 580 poke54276,17:fort=1to200:next
  52. 590 poke54276,16:fort=1to50:next
  53. 600 return
  54. 610 j=32-m:f(u+1)=-1:g(u+1)=0
  55. 620 print"[147]";j;"pegs remaining"
  56. 630 ifj>10then print"poor!":w=-1:goto700
  57. 640 ifj>7then print"satisfactory play!":w=-1:goto700
  58. 650 ifj>5then print"good!":w=4:goto700
  59. 660 ifj>3then print"great!":w=5:goto700
  60. 670 ifj>2then print"well played!":w=11:goto700
  61. 680 ifj>1then print"missed!":w=6:goto700
  62. 690 ifj>0then print"did it!":w=6:goto700
  63. 700 print"want to save? (y/n)"
  64. 710 getk$:if k$=""then710
  65. 720 if k$<>"n"andk$<>"y"then 710
  66. 730 ifk$="n" then 800
  67. 740 input"filename";n$:input"your name";m$
  68. 750 open15,8,15:open2,8,2,"@0:"+n$+",s,w"
  69. 760 print#2,m$:forv=1tou+1
  70. 770 print#2,f(v)
  71. 780 print#2,g(v):next v
  72. 790 close2:close15
  73. 800 print"want to play? (y/n)"
  74. 810 ifw<0thengoto840
  75. 820 qz=4*40:fork=qz+55336toqz+55336+w:pokek,v:v=v+1:ifv>255thenv=0
  76. 830 next k
  77. 840 get m$:if m$="" then 810
  78. 850 if m$="n"thenprint"[147]":end
  79. 860 if m$="y" thengoto 120
  80. 870 goto 840
  81. 880 jj=49152:jh=int(jj/256):jl=jj-jh*256:poke785,jl:poke786,jh
  82. 890 fork=jjtojj+67:read y:pokek,y:next
  83. 900 data 120,70,97,176,21,169,127,141
  84. 910 data 0,220,173,1,220,201,255,240
  85. 920 data 4,169,31,208,13,173,0,220
  86. 930 data 16,8,169,255,141,0,220,173
  87. 940 data 1,220,41,31,73,15,208,4
  88. 950 data 133,97,240,23,133,98,169,136
  89. 960 data 133,97,169,0,133,99,133,100
  90. 970 data 133,101,133,102,198,97,6,98
  91. 980 data 16,250,88,96
  92. 990 return
  93. 1000 print"[147]play, watch a replay (p/r)"chr$(142)
  94. 1010 getf$:iff$=""then1010
  95. 1020 iff$="p" then 1050
  96. 1030 iff$="r"then 1120
  97. 1040 goto 1010
  98. 1050 print"[147]one or two player game? (1/2)"
  99. 1060 get i$::ifi$=""then1060
  100. 1070 ifi$="1"then i=0:goto1100
  101. 1080 ifi$="2" theni=1:goto 990
  102. 1090 goto 1060
  103. 1100 h=0:print"joystick in port 2"
  104. 1110 print"press "chr$(34)"@"chr$(34)" to end":for e=1 to 900:next:return
  105. 1120 u=0:n=0:input"filename";n$
  106. 1130 open15,8,15:open2,8,2,"0:"+n$+",s,r":input#2,m$
  107. 1140 goto 1330
  108. 1150 input#2,f(u),g(u)
  109. 1160 iff(u)=-1 then u=u-1:goto1180
  110. 1170 u=u+1:goto 1150
  111. 1180 h=-1:print"[147]":goto150
  112. 1190 s=1475:ti%=200
  113. 1200 for v=0tou
  114. 1210 e=s+g(v):geta$
  115. 1220 if f(v)=0then pokes,peek(s)-128:poke e,peek(e) +128:s=s+g(v)
  116. 1230 if f(v)=1 thenpokes,32:pokee,32:pokee+g(v),215 :s=s+g(v)+g(v):gosub560
  117. 1240 ifa$="f"thenti%=ti%-50
  118. 1250 ifa$="l"thenti%=ti%+50
  119. 1260 if ti%>1000thenti%=1000
  120. 1270 if ti%<0thenti%=0
  121. 1280 fora=1toti%:next:nextv:print"by:";m$
  122. 1290 print"press space bar to continue"
  123. 1300 geta$:ifa$<>" "then 1300
  124. 1310 close2:close15
  125. 1320 restore:goto 110
  126. 1330 input#15,en,em$,et,es
  127. 1340 if en>0thenprintem$:goto 1360
  128. 1350 goto 1150
  129. 1360 close15:close2:goto 1120
  130.