home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 210 / 210.d81 / pyramid (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  6KB  |  209 lines

  1. 0 v=peek(186)
  2. 1 ifx=0thenx=1:print"[147][144][194]uilding the [208]yramid...":load"unpacker",v,1
  3. 2 ifx=1thenx=2:load"pyramid.shps.lnk",v,1
  4. 3 ifx=2thenx=3:load"lineplot.o",v,1
  5. 4 ifx=3thenx=4:load"joeplay",v,1
  6. 5 ifx=4thenx=5:load"taps",v,1
  7. 6 ifx=5thenx=6:load"victory",v,1
  8. 7 text=50759:plot=51462:hi=51459
  9. 10 print"[147]":poke53280,0:poke53281,0
  10. 70 dimx(15),y(15),p(15):n=15:s=1:b=0
  11. 72 ss$="                                       "
  12. 170 goto280
  13. 180 rem erase bottom
  14. 182 forll=21to23:systext,ss$,0,ll*8:next:return
  15. 184 :
  16. 210 remsetallpiecesinholes
  17. 220 fori=1to15:ag=1:p(i)=ag:next:ki=int(rnd(1)*15)+1:return
  18. 230 reminitialization
  19. 280 fori=1to15:readx(i),y(i):nexti
  20. 290 gosub220
  21. 350 print"[147]"spc(11)"[204][207][193][196][211][212][193][210] [208][210][197][211][197][206][212][211]"
  22. 352 print""spc(16)"[208][217][210][193][205][201][196]"
  23. 354 print""spc(15)"[208][160][207][160][215][160][197][160][210]"
  24. 356 print""spc(12)"[211][160][212][160][210][160][213][160][199][160][199][160][204][160][197]"
  25. 380 print""spc(12)"[194][217][160][193][204][193][206][160][199][193][210][196][206][197][210]"
  26. 381 printspc(13)"[195][207][208][217][210][201][199][200][212] 1986"
  27. 382 print""spc(12)"[198][210][207][205][160][193][206][160][201][196][197][193] [194][217]"
  28. 384 printspc(14)"[211][193][206][196][217][160][211][205][201][212][200]"
  29. 390 print"     [204][207][193][196][211][212][193][210] [201][211] [206][207][212] [208][213][194][204][201][195] [196][207][205][193][201][206]."
  30. 392 print"   [208][204][197][193][211][197] [210][197][211][208][197][195][212] [212][200][197] [193][213][212][200][207][210]'[211] [210][201][199][200][212][211]."
  31. 400 ifb=1then450
  32. 410 print"     [196][207] [217][207][213] [215][193][206][212] [201][206][211][212][210][213][195][212][201][207][206][211]? ([217]/[206])";
  33. 412 poke198,0:wait198,1:getq$:ifq$="y"then1080
  34. 420 ifq$<>"n"then412
  35. 450 remshowgameboard
  36. 455 x=0:y=0:sh=0:gosub20000:sys51459
  37. 456 forz=1to15:sh=3:ifz=kithensh=2
  38. 457 x=x(z):y=y(z):gosub20000:next
  39. 460 gosub180
  40. 471 systext,"which piece do you want to remove       first? (a-o)",0,176
  41. 472 poke198,0:wait198,1:getq$:q=asc(q$)-64:ifq<1orq>15then460
  42. 473 systext,q$,14*8,176+8:gosub180
  43. 474 gl=0:ifq=kithensystext,"not the pharaoh...",0,176:gl=1
  44. 475 ifgl=1thenfordl=1to1000:next:goto471
  45. 481 p(q)=0:n=n-1:sh=3:x=x(q):y=y(q):so=3:gosub30000
  46. 483 sh=1:gosub20000
  47. 490 systext,"press 'q' to quit",0,21*8
  48. 492 systext,"pieces left",22*8,21*8
  49. 493 systext,"pieces removed",22*8,22*8
  50. 500 remmainprogram
  51. 510 n$=mid$(str$(n),2):ifn<10thenn$=" "+n$
  52. 520 systext,n$,37*8,21*8
  53. 530 r=15-n:r$=mid$(str$(r),2):ifr<10thenr$=" "+r$
  54. 540 systext,r$,37*8,22*8
  55. 550 remplayerinput
  56. 560 ot$="overthrows:"+str$(ot)+"  ":systext,ot$,178,1
  57. 561 systext,ss$,0,23*8
  58. 562 systext,"from: ",0,23*8
  59. 563 poke198,0:wait198,1:getq$:ifq$="q"then960
  60. 564 ifq$="w"thenn=2:goto560
  61. 570 rem
  62. 580 f=asc(q$+chr$(0))-64:iff<1orf>15then560
  63. 590 ifp(f)=0then560:remnopiecein"[198][210][207][205]"
  64. 592 systext,q$,7*8,23*8
  65. 600 systext,"        ",12*8,23*8
  66. 601 systext,"to: ",12*8,23*8
  67. 602 poke198,0:wait198,1:getq$:printq$;:ifq$="q"then960
  68. 610 rem
  69. 620 t=asc(q$+chr$(0))-64:ift<1ort>15then600
  70. 630 ifp(t)=1then560:rempiecein"[212][207]"
  71. 635 systext,q$,16*8,23*8
  72. 637 rem **************
  73. 640 remcheckforrightrow/column
  74. 650 ify(t)<>y(f)then690:remnotinsamerow
  75. 660 yy=y(t):ifabs(x(t)-x(f))=12thenxx=(x(t)+x(f))/2:goto770
  76. 680 goto560
  77. 690 ify(f)>y(t)then730
  78. 700 yy=y(f)+4:ifx(f)-6=x(t)thenxx=x(f)-3:goto770
  79. 710 ifx(f)+6=x(t)thenxx=x(f)+3:goto770
  80. 720 goto560
  81. 730 yy=y(t)+4:ifx(t)+6=x(f)thenxx=x(t)+3:goto770
  82. 740 ifx(f)+6=x(t)thenxx=x(f)+3:goto770
  83. 750 goto560
  84. 760 remmakesurethereisapegtojump
  85. 770 fori=1to15:ifxx=x(i)andyy=y(i)thenpn=i:i=15:goto790
  86. 780 ifxx-2=x(i)andyy=y(i)thenpn=i:i=15
  87. 790 nexti
  88. 800 ifp(pn)=0then560:remnopiecetojump
  89. 810 p(pn)=0:p(f)=0:p(t)=1
  90. 815 rem *************
  91. 816 rem *************
  92. 820 remmovepiece
  93. 830 rem erase piece in from
  94. 832 sh=3:ifki=fthensh=2
  95. 834 x=x(f):y=y(f):so=1:gosub30000
  96. 835 sh=1:gosub20000
  97. 840 :
  98. 860 rem  draw piece in to
  99. 872 sh=3:ifki=fthensh=2
  100. 873 x=x(t):y=y(t):so=2:gosub30000
  101. 874 sh=3:ifki=fthensh=2:ki=t
  102. 875 gosub20000
  103. 876 :
  104. 880 rem  remove jumped piece
  105. 890 n=n-1
  106. 892 sh=3:ifpn=kithensh=2
  107. 893 x=x(pn):y=y(pn):so=3:gosub30000
  108. 894 sh=1:gosub20000
  109. 895 :
  110. 896 ifki=pnthenx=x(t):y=y(t):sh=2:so=1:gosub30000:ot=ot+1:sh=2:gosub20000:ki=t
  111. 900 ifn>1then510
  112. 910 rem win if 1 piece left
  113. 920 gosub180:systext,"congratulations!  you won!!",24,21*8
  114. 940 goto1000
  115. 950 remplayerquit-givescore
  116. 960 gosub180:n$="pieces left:"+str$(n)+"    ":systext,n$,0,21*8
  117. 961 systext,"score:",0*8,22*8:x=9*8:y=22*8
  118. 962 ifn=2thensystext,"above average",x,y:goto1000
  119. 970 ifn=3thensystext,"average",x,y:goto1000
  120. 980 ifn=4thensystext,"fair",x,y:goto1000
  121. 982 systext,"pretty rotten",x,y
  122. 983 poke252,161:poke251,0:sys49152
  123. 984 ifpeek(788)<>49then984
  124. 990 remend
  125. 1000 ifn<>1then1005
  126. 1003 systext,"press a key to see your rating...",2*8,23*8:poke198,0:wait198,1
  127. 1004 gosub40000
  128. 1005 systext,"        play again? (y/n)             ",3*8,23*8
  129. 1006 poke198,0:wait198,1:getq$:ifq$="n"then1030
  130. 1010 ifq$<>"y"then1006
  131. 1020 gosub220:n=15:ot=0:goto456
  132. 1030 sys51459:print"[147]         [212]hank you for playing"
  133. 1032 print""spc(16)"[208][217][210][193][205][201][196]"
  134. 1034 print""spc(15)"[208][160][207][160][215][160][197][160][210]"
  135. 1036 print""spc(12)"[211][160][212][160][210][160][213][160][199][160][199][160][204][160][197]"
  136. 1040 rem
  137. 1050 goto41000
  138. 1060 end
  139. 1070 reminstructions
  140. 1080 print"[147]        [208][217][210][193][205][201][196][160][208][207][215][197][210][160][211][212][210][213][199][199][204][197]"
  141. 1090 print" [217][207][213][210] [199][207][193][204] [201][211] [212][207] [210][197][205][207][214][197] [193][211] [205][193][206][217] [211][195][210][201][194][197][211]":print
  142. 1092 print"[193][211] [208][207][211][211][201][194][204][197] [198][210][207][205] [212][200][197] [194][207][193][210][196] [194][217] [202][213][205][208][201][206][199]":print
  143. 1100 print"[207][214][197][210] [207][206][197] [211][195][210][201][194][197] [193][212] [193] [212][201][205][197] [201][206][212][207] [193][206]":print:print"[197][205][208][212][217] [211][208][193][195][197].":print
  144. 1108 print" [201][198][160][193][160][208][200][193][210][207][193][200][160][201][211][160][202][213][205][208][197][196], [212][200][193][212][160][201][211]":print
  145. 1109 print"[195][207][206][211][201][196][197][210][197][196][160][193][206][160][207][214][197][210][212][200][210][207][215].  [203][197][197][208][160][201][206][160][205][201][206][196]":print
  146. 1110 print"[212][200][193][212] [212][200][197][160][198][197][215][197][210][160][207][214][197][210][212][200][210][207][215][211][160][217][207][213] [200][193][214][197], [212][200][197]":print
  147. 1112 print"[194][197][212][212][197][210][160][217][207][213][210] [210][193][212][201][206][199][160][215][201][204][204] [194][197], [201][198][160][217][207][213][160][215][201][206]":print"[212][200][197][160][199][193][205][197].":print
  148. 1120 print"  [201][198] [217][207][213] [200][193][214][197] [205][207][210][197] [212][200][193][206] [207][206][197] [208][201][197][195][197] [204][197][198][212]"
  149. 1122 print"[215][201][212][200][207][213][212] [193][206][217] [204][197][199][193][204] [205][207][214][197][211] [193][214][193][201][204][193][194][204][197], [208][210][197][211][211]   ";
  150. 1123 printchr$(34)"[209]"chr$(34)" [212][207][160][209][213][201][212][160][193][206][196][160][199][197][212][160][217][207][213][210][160][210][193][212][201][206][199]."
  151. 1130 print"          [208][210][197][211][211] [193] [203][197][217] [212][207][160][194][197][199][201][206]";:poke198,0:wait198,1
  152. 1140 getq$:b=1:goto350
  153. 1150 rempiecelocations
  154. 1160 data17,0,14,4,20,4,11,8,17,8,23,8,8,12,14,12,20,12,26,12,5,16,11,16
  155. 1170 data17,16,23,16,29,16
  156. 10000 d=peek(186):n$="pyramid":open15,d,15,"s0:"+n$:close15:saven$,d:end
  157. 20000 rem shape stuff
  158. 20010 poke249,224:poke250,204:poke251,0:poke252,64:poke253,x:poke254,y
  159. 20020 poke255,sh:sysplot
  160. 20030 return
  161. 30000 rem   sound routines
  162. 30005 ss=sh:si=54272
  163. 30010 ifso=1orso=2thengosub31000:return
  164. 30030 gosub33000:return
  165. 30040 :
  166. 31000 rem  sound t
  167. 31010 pokesi+1,14:pokesi+5,3:pokesi+6,255-15:pokesi+24,15:pokesi+4,1