home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 48 / 048side1.d81 / marienbad (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  10KB  |  274 lines

  1. 2 gosub2190
  2. 3 ifa=0thenpoke55,0:poke56,56:clr:a=1
  3. 4 ifa=1thena=2:load"mb.font",8,1
  4. 10 dim a$(16):y=1:ss=1:dimj(4,7,7)
  5. 20 poke53280,0:poke53281,4
  6. 50 poke53272,(peek(53272)and240)+14:printchr$(8)
  7. 60 gosub2200
  8. 70 print"[147][156]";:poke53281,0:poke53280,2
  9. 80 ifa$="y"thengosub750
  10. 90 a=1:b=1:c=1:y=1:ss=1
  11. 100 print"[147]":gosub 700:print"[147]"
  12. 110 gosub2390:forxx=1to16:a$(xx)=s$:nextxx
  13. 120 c=0:yy=-1:gosub460
  14. 130 print"[150]  "nm$(1)
  15. 140 ifnm$(1)="computer"thengosub1020
  16. 150 c=1:b=1:a=1:print"^";
  17. 160 jr=peek(56320):geta$
  18. 165 ifa$="[140]"then650
  19. 170 if(jr=125ora$="")anda<4thena=a+1:b=b+1:c=c+2:gosub260
  20. 180 if(jr=119ora$="")andb<cthenb=b+1:gosub260
  21. 190 if(jr=126ora$="[145]")anda>1andb>1andb<>cthena=a-1:b=b-1:c=c-2:gosub260
  22. 200 ifb>1and(jr=123ora$="[157]")thenb=b-1:gosub260
  23. 210 ifb=7andss=0andjr=119thenprint"[157] [157][146]   ^";:b=b+1
  24. 220 ifss=0and(jr=109ora$="*")thenjr=0:print"[157] [157]";:gosub350:gosub260:ss=1
  25. 230 if(jr=111ora$=chr$(13))and(w=a or w=0)thengosub420:gosub260
  26. 240 ifrt=1thenrt=0:goto110
  27. 250 goto160
  28. 260 print"[157] [157]";
  29. 270 ifrt=1thenreturn
  30. 280 print"";
  31. 290 forz=1to((a-1)*4):print"[157]";:next
  32. 300 forz=1to(a*6):print"";:nextz
  33. 310 forz=1tob*4:print"";:next
  34. 320 ifa=1andb=1andc=1thenprint"";
  35. 330 print"^";
  36. 340 return
  37. 350 a=1:b=1:c=1:w=0:ss=1
  38. 360 ify<>2then370
  39. 365 poke53280,2:print"[150]  "nm$(1);:forii=1to11-len(nm$(1)):print" ";:next
  40. 367 y=1:gosub400:return
  41. 370 poke53280,3:print"[153]  "nm$(2);:y=2:forii=1to11-len(nm$(2)):print" ";:next
  42. 380 ifnm$(2)="computer"thengosub1020
  43. 390 return
  44. 400 ifnm$(1)="computer"thengosub1020
  45. 410 return
  46. 420 ifj(a,b,c)=0thenreturn
  47. 430 w=a:ss=0
  48. 440 dd=((a*a)-(c-b))
  49. 450 a$(dd)="[144]   [157][157][157]   [157][157][157]   [157][157][157]   [157][157][157]   [156]"
  50. 460 print"[156]";a$(1)
  51. 470 print"";a$(2);"[145][145][145][145]";a$(3);"[145][145][145][145]";a$(4)
  52. 480 print"";a$(5);"[145][145][145][145]";a$(6);"[145][145][145][145]";a$(7);"[145][145][145][145]";a$(8);"[145][145][145][145]";
  53. 490 printa$(9)
  54. 500 print"";a$(10);"[145][145][145][145]";a$(11);"[145][145][145][145]";a$(12);"[145][145][145][145]";a$(13);"[145][145][145][145]";
  55. 510 printa$(14);"[145][145][145][145]";a$(15);"[145][145][145][145]";a$(16);"[146]     ";
  56. 520 forz8=217to242:pokez8,peek(z8)or128:next
  57. 523 print"  joystick":print"[158] fire button"
  58. 525 print"  to remove":print"  fire down"
  59. 530 print"   to end"
  60. 532 print"    turn"
  61. 536 printspc(30)"press f8"
  62. 537 printspc(30)"to quit"
  63. 540 gosub670
  64. 550 yy=yy+1:ifyy=16thenprint"[147][156]":goto570
  65. 560 j(a,b,c)=0:return
  66. 570 ify=2thenprintspc(20-(len(nm$(1))/2))nm$(1)
  67. 580 ify=1thenprintspc(20-(len(nm$(2))/2))nm$(2)
  68. 585 printspc(10)"is the grand champion!"
  69. 590 forf=1to2:forg=1to16:poke53280,g:forh=1to150:next:next:next
  70. 600 poke53280,2:print"play again? (y/n)"
  71. 610 getp$:ifp$<>"y"andp$<>"n"then610
  72. 620 ifp$="y"thenprint"[144]":run10
  73. 650 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  74. 655 print"[147]":poke53272,21:ifer<>63thenend
  75. 657 load"hello connect",8
  76. 670 print"";tab(26);"cursor  keys"
  77. 680 printtab(26);"[158]press return"
  78. 685 printtab(26);" to  remove"
  79. 690 printtab(27);"press * to"
  80. 695 printtab(27);" end turn"
  81. 697 return
  82. 700 print"[147]enter name, player 1"
  83. 705 printtab(11);:gosub3000:nm$(1)=kk$
  84. 710 poke 53280,3:print"[147]enter name, player 2"
  85. 715 printtab(11);:gosub3000:nm$(2)=kk$
  86. 720 poke53280,2
  87. 730 ifnm$(1)=nm$(2)then700
  88. 740 print"[147]":return
  89. 750 print"[147] the object of this game is to avoid"
  90. 760 print" removing the last carpet on the board."
  91. 790 print"   players alternate turns removing"
  92. 800 print"   according to two separate rules:"
  93. 830 print"   1) in any one turn a player may"
  94. 840 print"      remove carpets from only one"
  95. 850 print"      horizontal row."
  96. 860 print"   2) any number of carpets"
  97. 870 print"      from that row may be removed."
  98. 880 print
  99. 890 print" use joystick in port #2 or the cursor"
  100. 900 print" keys to place the pointer.  press the"
  101. 905 print"  fire button or return to remove a"
  102. 910 print" carpet.  press '*' or the firebutton"
  103. 915 print"with the joystick down to end your turn."
  104. 920 print" to play the computer, enter 'computer'"
  105. 925 print"            as either player."
  106. 930 print:print"        [158]press any key to begin[145]"
  107. 940 getww$:ifww$="" then 940
  108. 950 print"[147]"
  109. 960 j(1,1,1)=1:j(2,1,3)=1:j(2,2,3)=1
  110. 970 j(2,3,3)=1:j(3,1,5)=1:j(3,2,5)=1
  111. 980 j(3,3,5)=1:j(3,4,5)=1:j(3,5,5)=1
  112. 990 j(4,1,7)=1:j(4,2,7)=1:j(4,3,7)=1
  113. 1000 j(4,4,7)=1:j(4,5,7)=1:j(4,6,7)=1
  114. 1010 j(4,7,7)=1:return
  115. 1020 for x=1to4:rr(x)=0:next
  116. 1030 for a=1to4
  117. 1040 for b=1to(a*2-1)
  118. 1050 c=a*2-1
  119. 1060 ifj(a,b,c)=1thenrr(a)=rr(a)+1
  120. 1070 next:next
  121. 1080 tn=0:forx=1to4
  122. 1090 ifrr(x)>=1thentn=tn+1
  123. 1100 next
  124. 1110 tp=0
  125. 1120 iftn<>1then1190
  126. 1125 iftn=1thenifrr(1)=1thentk=1:tx=1:gosub 2090:return
  127. 1130 ifrr(2)=1thentk=1:tx=2:gosub 2090:return
  128. 1140 ifrr(3)=1thentk=1:tx=3:gosub 2090:return
  129. 1150 ifrr(4)=1thentk=1:tx=4:gosub 2090:return
  130. 1160 ifrr(2)>1thentk=rr(2)-1:tx=2:gosub2090:return
  131. 1170 ifrr(3)>1thentk=rr(3)-1:tx=3:gosub2090:return
  132. 1180 ifrr(4)>1thentk=rr(4)-1:tx=4:gosub2090:return
  133. 1190 iftn<>2then1320
  134. 1195 iftn=2thenifrr(1)=1thenifrr(1)=rr(2)thentk=1:tx=1:gosub2090:return
  135. 1200 ifrr(1)=1thenifrr(1)=rr(3)thentk=1:tx=3:gosub2090:return
  136. 1210 ifrr(1)=1thenifrr(1)=rr(4)thentk=1:tx=1:gosub2090:return
  137. 1220 ifrr(1)=1thenifrr(2)>rr(1)thentk=rr(2):tx=2:gosub2090:return
  138. 1230 ifrr(1)=1thenifrr(3)>rr(1)thentk=rr(3):tx=3:gosub2090:return
  139. 1240 ifrr(1)=1thenifrr(4)>rr(1)thentk=rr(4):tx=4:gosub2090:return
  140. 1250 ifrr(2)=1andrr(3)>1thentk=rr(3):tx=3:gosub2090:return
  141. 1260 ifrr(2)=1andrr(4)>1thentk=rr(4):tx=4:gosub2090:return
  142. 1270 ifrr(3)=1andrr(4)>1thentk=rr(4):tx=4:gosub2090:return
  143. 1280 ifrr(2)>1andrr(3)=1thentk=rr(2):tx=2:gosub2090:return
  144. 1290 ifrr(2)>1andrr(4)=1thentk=rr(2):tx=2:gosub2090:return
  145. 1300 ifrr(3)>1andrr(4)=1thentk=rr(3):tx=3:gosub2090:return
  146. 1310 ifrr(2)>=1andrr(3)>=1thentp=1
  147. 1320 iftp=1thenifrr(2)=rr(3)thentk=1:tx=2:gosub2090:tp=0:return
  148. 1330 iftp=1thenifrr(2)>rr(3)thentk=rr(2)-rr(3):tx=2:gosub2090:tp=0:return
  149. 1340 iftp=1thenifrr(2)<rr(3)thentk=rr(3)-rr(2):tx=3:gosub2090:tp=0:return
  150. 1350 iftn=2thenifrr(2)>=1andrr(4)>=1thentp=1
  151. 1360 iftp=1thenifrr(2)=rr(4)thentk=1:tx=2:gosub2090:tp=0:return
  152. 1370 iftp=1thenifrr(2)>rr(4)thentk=rr(2)-rr(4):tx=2:gosub2090:tp=0:return
  153. 1380 iftp=1thenifrr(2)<rr(4)thentk=rr(4)-rr(2):tx=4:gosub2090:tp=0:return
  154. 1390 iftn=2thenifrr(3)>=1andrr(4)>=1thentp=1
  155. 1400 iftp=1thenifrr(3)=rr(4)thentk=1:tx=3:gosub2090:tp=0:return
  156. 1410 iftp=1thenifrr(3)>rr(4)thentk=rr(3)-rr(4):tx=3:gosub2090:tp=0:return
  157. 1420 iftp=1thenifrr(3)<rr(4)thentk=rr(4)-rr(3):tx=4:gosub2090:tp=0:return
  158. 1430 iftn=3andrr(1)=1thentp=1
  159. 1440 iftp=1andrr(2)=3andrr(3)>2thentk=rr(3)-2:tx=3:gosub2090:return
  160. 1450 iftp=1andrr(2)=3andrr(4)>2thentk=rr(4)-2:tx=4:gosub2090:return
  161. 1460 iftp=1andrr(2)=2andrr(3)>3thentk=rr(3)-3:tx=3:gosub2090:return
  162. 1470 iftp=1andrr(2)=2andrr(4)>3thentk=rr(4)-3:tx=4:gosub2090:return
  163. 1480 iftp=1andrr(3)=2andrr(4)>3thentk=rr(4)-3:tx=4:gosub2090:return
  164. 1490 iftp=1andrr(3)=3andrr(4)>2thentk=rr(4)-2:tx=4:gosub2090:return
  165. 1500 iftp=1andrr(2)=rr(3)andrr(2)<>1thentp=0:tk=1:tx=1:gosub2090:return
  166. 1510 iftp=1andrr(4)=2andrr(3)>3thentk=rr(3)-3:tx=3:gosub2090:return
  167. 1520 iftp=1andrr(4)=3andrr(3)>2thentk=rr(3)-2:tx=3:gosub2090:return
  168. 1530 iftp=1andrr(2)=rr(4)andrr(2)<>1thentp=0:tk=1:tx=1:gosub2090:return
  169. 1540 iftp=1andrr(3)=rr(4)andrr(3)<>1thentp=0:tk=1:tx=1:gosub2090:return
  170. 1550 iftp=1andrr(2)=rr(3)andrr(2)=1thentp=0:tk=1:tx=1:gosub2090:return
  171. 1560 iftp=1andrr(2)=rr(4)andrr(2)=1thentp=0:tk=1:tx=1:gosub2090:return
  172. 1570 iftp=1andrr(3)=rr(4)andrr(3)=1thentp=0:tk=1:tx=1:gosub2090:return
  173. 1580 iftp=1andrr(2)=1andrr(3)>1thentp=0:tk=rr(3)-1:tx=3:gosub2090:return
  174. 1590 iftp=1andrr(3)=1andrr(2)>1thentp=0:tk=rr(2)-1:tx=2:gosub2090:return
  175. 1600 iftp=1andrr(3)=1andrr(4)>1thentp=0:tk=rr(4)-1:tx=4:gosub2090:return
  176. 1610 iftp=1andrr(4)=1andrr(3)>1thentp=0:tk=rr(3)-1:tx=3:gosub2090:return
  177. 1620 iftp=1andrr(4)=2andrr(3)>3thentk=rr(3)-(rr(3)-3):tx=3:gosub2090:return
  178. 1630 iftp=1andrr(2)=2andrr(3)>3thentk=rr(3)-(rr(3)-3):tx=3:gosub2090:return
  179. 1640