home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1986 September / Ahoy_Magazine_86-09_1986_Double_L.d64 / Matchblocks (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  4KB  |  87 lines

  1. 10 print"[147]"spc(4)"[159]m a t c h b l o c k s[154]"
  2. 20 dimcr(55),ul(55),ur(55),ll(55),lr(55),r(99),t(55),s(25),bk(3),pla,match
  3. 30 dim hf(6),lf(6),dr(6):fl=1:td=720:trn=1:poke198,0
  4. 40 restore:fora=1to27:readcr(a),ul(a),ur(a),ll(a),lr(a):next
  5. 50 fora=1to6:readhf(a),lf(a),dr(a):next
  6. 60 print"[154][176][192][192][178][192][192][178][192][192][178][192][192][178][192][192][178][192][192][178][192][192][178][192][192][178][192][192][174]";:print"  [159]score[154]":fora=1to5:gosub90
  7. 70 print"[171][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][219][192][192][179]":nexta:gosub90
  8. 80 print"[173][192][192][177][192][192][177][192][192][177][192][192][177][195][195][177][192][192][177][192][192][177][192][192][177][192][192][189]":goto100
  9. 90 forb=1to2:print"[221]  [221]  [221]  [221]  [221]  [221]  [221]  [221]  [221]  [221]":next:return
  10. 100 gosub690:input"[159]how many players";p$:p=val(p$)
  11. 110 if(p<1)or(p>10)thengosub640:print"sorry, 1 to 10 players only":goto100
  12. 120 gosub680:fora=1top:print"type name of player";a:inputn$(a)
  13. 130 n$(a)=left$(n$(a),9):l=len(n$(a)):print"[145]  "n$(a);:forb=1to26:forc=1tol
  14. 140 print"[157]";:next:print" "n$(a);:ford=1to15:nextd,b:fore=1to(21-a*2):forf=1tol
  15. 150 print"[157]";:nextf:print"          [145][157][157][157][157][157][157][157][157][157][157]"n$(a);:forg=1to20:nextg,e
  16. 160 print:printtab(38)"[145]0[157]":gosub690:nexta
  17. 170 print"do you want a match to be 2 identical"
  18. 180 print"blocks or 3? (press 2 or 3)"
  19. 190 geti$:i=val(i$):ifi<>2andi<>3goto190
  20. 200 gosub680:sc=160:m=54:q=0:forj=1tom:t(j)=j:nextj:forj=mto1step-1
  21. 210 r=int(j*rnd(0)+1):r(j)=t(r):fork=rtoj:t(k)=t(k+1):nextk
  22. 220 q=q+1:bb=q:gosub650:nextj
  23. 230 forn=1tom:ifr(n)>m/ithenr(n)=r(n)-m/i:ifi=3andr(n)>18thenr(n)=r(n)-18
  24. 240 next
  25. 250 v=53248:pokev+21,4:poke2042,13:pokev+41,1
  26. 260 forn=18to45step3:poke832+n,1:poke833+n,255:poke834+n,128:next
  27. 270 pokev+4,124:pokev+5,111
  28. 280 blk=23:x=124:y=111:bk(2)=0:bk(3)=99:pla=pla+1:ifpla>pthenpla=1:trn=trn+1
  29. 290 fl=1:gosub690:print"round number";trn:ifmatch<m/ithen330
  30. 300 print"[145]game over":print"press fire button to play again."
  31. 310 a=peek(56321)and16:ifa=16then310
  32. 320 run
  33. 330 print"it is your turn, ";n$(pla);"        "
  34. 340 pokev+21,4:pokev+4,x:pokev+5,y:jv=255-peek(56321)
  35. 350 ifjv=1theny=y-24:goto410
  36. 360 ifjv=2theny=y+24:goto410
  37. 370 ifjv=8thenx=x+24:goto410
  38. 380 ifjv=4thenx=x-24:goto410
  39. 390 ifjv>10thenrow=(y-39)/24:col=(x-4)/24:bk(fl)=blk:goto460
  40. 400 pokev+21,0:forg=1to15:next:goto340
  41. 410 forg=1to60:next:ify<63theny=63:goto340
  42. 420 ify>183theny=183:goto340
  43. 430 ifx<28thenx=28:goto340
  44. 440 ifx>220thenx=220:goto340
  45. 450 blk=(9*y+x-571)/24:goto340
  46. 460 if(r(blk)=0)or(bk(2)=bk(1))or(bk(3)=bk(2))or(bk(3)=bk(1))goto340
  47. 470 pokev+21,0:pt=1105+(row-1)*120+(col-1)*3:pc=pt+54272:b=r(blk)
  48. 480 pokept,ul(b):pokept+1,ur(b):pokepc,cr(b):pokepc+1,cr(b):pokept+40,ll(b)
  49. 490 pokept+41,lr(b):pokepc+40,cr(b):pokepc+41,cr(b):iffl=igoto520
  50. 500 bk(fl)=blk:x=124:y=111:blk=23:ifbk(fl)=23thenx=124:y=135:blk=32
  51. 505 if(bk(1)=23andbk(2)=32)or(bk(1)=32andbk(2)=23)thenx=124:y=87:blk=14
  52. 510 fl=fl+1:goto340
  53. 520 ifr(bk(1))<>r(bk(2))then580
  54. 530 ifi=3andr(bk(2))<>r(bk(3))then580
  55. 540 s=54272:pokes+5,15:pokes+6,0:pokes+24,10
  56. 550 fora=1to6:print"    m a t c h [146]":pokes+1,hf(a):pokes,lf(a):pokes+4,17
  57. 560 forb=1todr(a):nextb:print"   [146] m a t c h ":pokes+4,16:forc=1to50:nextc,a
  58. 570 goto610
  59. 580 gosub690:print"         no match [146]"
  60. 590 fora=1to30:poke54296,5:poke54296,0:next:gosub690
  61. 600 sc=160:fora=1toi:bb=bk(a):gosub650:next:goto280
  62. 610 s(pla)=s(pla)+1:poke214,(1+pla*2):print:poke211,37:prints(pla)
  63. 620 match=match+1:r(bk(1))=0:r(bk(2))=0:r(bk(3))=0
  64. 630 sc=32:fora=1toi:bb=bk(a):gosub650:next:pla=pla-1:goto280
  65. 640 fora=1to30:poke54296,5:poke54296,0:next:return
  66. 650 pt=1009+93*int((bb+8)/9)+3*bb:pc=pt+54272
  67. 660 pokepc,14:pokepc+1,14:pokepc+40,14:pokepc+41,14
  68. 670 pokept,sc:pokept+1,sc:pokept+40,sc:pokept+41,sc:return
  69. 680 poke214,21:print:poke211,0:forz=1to35:print" ";:next
  70. 690 poke214,20:print:poke211,1:forz=1to40:print" ";:next:print"[145]";:return
  71. 700 data01,233,223,95,105,13,122,76,80,79,07,108,123,124,126
  72. 710 data10,77,78,78,77,10,91,91,91,91,03,32,160,160,32
  73. 720 data07,118,117,118,117,07,76,122,103,101,13,233,121,95,120
  74. 730 data10,63,63,63,63,10,85,73,74,75,03,127,32,32,127
  75. 740 data01,102,102,102,102,01,90,90,90,90,00,65,65,65,65
  76. 750 data10,83,83,83,83,13,13,13,13,13,10,79,80,76,122
  77. 760 data03,32,255,255,32,13,121,223,120,105,13,2,2,2,2
  78. 770 data05,36,36,36,36,03,121,121,106,116,07,121,121,120,120
  79. 780 data03,87,87,87,87,03,160,32,32,160,07,112,110,109,125
  80. 790 data12,143,40,15,210,40,18,209,40,25,30,150,18,209,40,25,30,800
  81. 800 print"[147]":poke53269,0:restore:g=1104:forf=1to27:reada,b,c,d,e
  82. 810 pokeg,b:pokeg+1,c:pokeg+54272,a:pokeg+54273,a
  83. 820 pokeg+40,d:pokeg+41,e:pokeg+54312,a:pokeg+54313,a
  84. 830 g=g+4:ifg=1140theng=1264
  85. 840 ifg=1300theng=1424
  86. 850 next:forg=1to12:print:next
  87.