home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 11 / 011.d81 / concentration (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  4KB  |  103 lines

  1. 100 clr:restore
  2. 105 print"[147][155]"tab(18)"concentration"tab(48)"(c) 1984 matthew oldham"
  3. 110 s=54272:v=53248:pokev+33,6:pokev+32,14
  4. 112 dimx(13),cd(13),ud(4,13),sd(4,13)
  5. 115 fori=0to2:poke12288+i,0:nexti
  6. 120 fori=3to62step3:poke12288+i,15:poke12289+i,255:poke12290+i,240:nexti
  7. 130 poke2040,192:poke2041,192:pokev+21,3:pokev+27,3:pokev+39,1:pokev+40,1
  8. 135 readnl$:pl=1264
  9. 140 print"do you wish to play against the computer"
  10. 141 input"(1) or against other humans(2-10)";np
  11. 150 if np<1ornp>10then140
  12. 160 fori=1to3:readbb$:forj=1to13:gl$(i)=gl$(i)+bb$:nextj:nexti:readnm$
  13. 170 gl$(4)=gl$(3):gl$(3)=gl$(2):fori=1to4:ready(i),st(i),bl(i):nexti
  14. 175 fori=1to13:readx(i),cd(i):nexti
  15. 180 print"[147]":printnm$:fori=1to4:forj=1to4:printgl$(j):next:next
  16. 190 fori=1to4:pl=pl+121
  17. 200 forj=1to13
  18. 210 rw=int(rnd(1)*4+1):cl=int(rnd(1)*13+1)
  19. 220 ifud(rw,cl)=32then210
  20. 230 sd(i,j)=cd(cl):ud(rw,cl)=32:pokepl,cd(cl):pokepl+40,st(rw)
  21. 240 pokepl+54272,6:pokepl+54312,6:pl=pl+3
  22. 250 nextj:nexti
  23. 260 fori=1tonp
  24. 270 print"":forj=1to6:printnl$:nextj
  25. 280 print"player number ";i,"matches ";pm(i)
  26. 290 input"please choose card 1 (row,col)";ro(1),co(1)
  27. 291 ifro(1)<1orro(1)>4orco(1)<1orco(1)>13then280
  28. 295 ifsd(ro(1),co(1))=32thenprint"card gone!":goto280
  29. 300 ifx(co(1))>255thenpokev,x(co(1))-256:pokev+16,peek(v+16)or1:goto310
  30. 305 pokev,x(co(1))
  31. 310 pokev+1,y(ro(1))
  32. 315 input"please choose card 2 (row,col)";ro(2),co(2)
  33. 316 ifro(2)<1orro(2)>4orco(2)<1orco(2)>13then315
  34. 320 ifro(1)=ro(2)andco(1)=co(2)thenprint"they're the same card!":goto280
  35. 325 ifsd(ro(2),co(2))=32thenprint"card gone!":goto315
  36. 330 ifx(co(2))>255thenpokev+2,x(co(2))-256:pokev+16,peek(v+16)or2:goto340
  37. 335 pokev+2,x(co(2))
  38. 340 pokev+3,y(ro(2))
  39. 350 ifsd(ro(1),co(1))=sd(ro(2),co(2))thenpm(i)=pm(i)+1:gosub500:goto270
  40. 355 ud(ro(1),co(1))=sd(ro(1),co(1)):ud(ro(2),co(2))=sd(ro(2),co(2))
  41. 360 forj=1to2700:nextj:fork=0to3:pokev+k,0:nextk:pokev+16,0:nexti
  42. 370 ifnp=1thengosub560
  43. 380 goto260
  44. 390 ifnp=1then440
  45. 400 hs=1:fori=2tonp:ifpm(i)>pm(hs)thenhs=i:fl=0:goto410
  46. 405 ifpm(i)=pm(hs)thenfl=1
  47. 410 nexti
  48. 415 iffl=1thenprint"[147]there is a tie with ";pm(hs);" matches":goto430
  49. 420 print"[147]and the winner is player #";hs
  50. 430 print:print:fori=1tonp:print"player #";i,pm(i);" matches"
  51. 435 nexti:goto470
  52. 440 ifcm>pm(1)thenprint"[147]i win! i win! i win!"
  53. 450 ifcm<pm(1)thenprint"[147]rats! you win "
  54. 455 ifpm(1)=cmthenprint"[147]it's a tie!"
  55. 460 print"you have ";pm(1);" matches"tab(40)"and i have ";cm;" matches"
  56. 470 input"do you wish another game";an$
  57. 480 if an$="yes"oran$="y"thengoto100
  58. 490 goto63000
  59. 500 ud(ro(1),co(1))=32:ud(ro(2),co(2))=32:sd(ro(1),co(1))=32
  60. 505 forj=1to1500:nextj
  61. 510 sd(ro(2),co(2))=32:forj=1to2:el(j)=bl(ro(j))+3*co(j):nextj
  62. 520 pokes+24,15:pokes+5,65:pokes+6,136:pokes+1,57:pokes,172:pokes+4,17
  63. 525 forj=0to120step40:fork=0to2:pokeel(1)+j+k,32:nextk:nextj:pokes+4,16
  64. 530 pokes+1,40:pokes,200:pokes+4,17
  65. 535 forj=0to120step40:fork=0to2:pokeel(2)+j+k,32:nextk:nextj:pokes+4,16
  66. 540 forj=0to3:pokev+j,0:nextj:pokev+16,0
  67. 545 tm=tm+1:iftm=26then390
  68. 550 return
  69. 560 print"":forj=1to6:printnl$:nextj:print"my turn",cm;" matches"
  70. 565 fl=fl+1:iffl/2=int(fl/2)orpm(1)>11thengoto670
  71. 570 ro(1)=int(rnd(1)*4+1):co(1)=int(rnd(1)*13+1)
  72. 575 ifsd(ro(1),co(1))=32then570
  73. 580 ro(2)=int(rnd(1)*4+1):co(2)=int(rnd(1)*13+1)
  74. 590 ifro(1)=ro(2)andco(1)=co(2)then580
  75. 600 ifsd(ro(2),co(2))=32then580
  76. 610 ifx(co(1))>255thenpokev,x(co(1))-256:pokev+16,peek(v+16)or1:goto620
  77. 615 pokev,x(co(1))
  78. 620 ifx(co(2))>255thenpokev+2,x(co(2))-256:pokev+16,peek(v+16)or2:goto630
  79. 625 pokev+2,x(co(2))
  80. 630 pokev+1,y(ro(1)):pokev+3,y(ro(2))
  81. 640 ifsd(ro(1),co(1))=sd(ro(2),co(2))thencm=cm+1:gosub500:goto560
  82. 645 ud(ro(1),co(1))=sd(ro(1),co(1)):ud(ro(2),co(2))=sd(ro(2),co(2))
  83. 650 forj=1to2700:nextj:fork=0to3:pokev+k,0:nextk:pokev+16,0
  84. 660 return
  85. 670 ro(1)=int(rnd(1)*4+1):co(1)=int(rnd(1)*13+1)
  86. 680 ifsd(ro(1),co(1))=32then670
  87. 690 forj=1to4:fork=1to13
  88. 700 ifro(1)=jandco(1)=kthen720
  89. 710 if sd(ro(1),co(1))=ud(j,k)thenro(2)=j:co(2)=k:goto610
  90. 720 nextk:nextj
  91. 730 ro(2)=int(rnd(1)*4+1):co(2)=int(rnd(1)*13+1)
  92. 740 ifsd(ro(2),co(2))=32then730
  93. 750 ifro(1)=ro(2)andco(1)=co(2)then730
  94. 760 goto610
  95. 770 data"                                      ","[213][195][201]","[194] [194]","[202][195][203]"
  96. 775 data" 1  2  3  4  5  6  7  8  9  10 11 12 13"
  97. 780 data119,65,1341,151,83,1501,183,88,1661,215,90,1821
  98. 790 data24,1,48,11,72,17,96,10,120,20,144,57,168,56,192,55
  99. 800 data216,54,240,53,264,52,288,51,312,50
  100. 63000 rem   return to loadstar
  101. 63010 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
  102. 63020 poke631,13:poke632,13:poke198,2:end
  103.