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

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