home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 56 / 056.d81 / graph.bas (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  5KB  |  179 lines

  1. 10 gosub1530:gosub1340
  2. 20 dimp(1),o(1),d(1),v(1)
  3. 30 dimco(1):co(0)=1:co(1)=1
  4. 40 fori=0to7:readh(i),l(i):next
  5. 50 data 16,195,18,209,21,31,22,96,25,30,28,49,31,165,33,135:rem@ 01
  6. 60 v=54296:w=54276:aa=54277:hf=54273:lf=54272:ss=54278:ph=54275:pl=54274:rem@ 02
  7. 70 data66,78,67,77,86,87,81,177,050
  8. 80 dima(7):fori=0to3:reada(i):a(i+4)=a(i):next:readcr,oh,so,p(0),p(1)
  9. 90 x=rnd(-ti):s=1024
  10. 100 data-2,0,-2,2,0,2,2,2,2,0,2,-2,0,-2,-2,-2
  11. 110 dimb(7),c(7)
  12. 120 cm=55296-1024 :co=13 :c1=250
  13. 130 fori=0to7:readb(i),c(i):next
  14. 140 n=500:rem number of moves used in creating game
  15. 150 poke646,14:poke53281,14:print"[147]":poke53281,0
  16. 160 rem pick a starting position
  17. 170 u1=int(rnd(ti)*20)*2
  18. 180 v1=int(rnd(ti)*10)*2
  19. 190 pokes+u1+v1*40,so
  20. 200 pokes+u1+v1*40+cm,c1:rem@ m
  21. 206 rem@ i=m,i,v2,oh,so,co,c1,h
  22. 210 fori=1ton
  23. 220 m=int(rnd(ti)*8)
  24. 230 u2=u1+c(m):ifu2<0oru2>38then220
  25. 240 v2=v1+b(m):ifv2<0orv2>20then220
  26. 250 l1=s+u1+v1*40
  27. 260 l2=s+u2+v2*40
  28. 270 l3=s+u1+v1*40+c(m)/2+b(m)*20
  29. 280 pokel1,oh :pokel1+cm,c1
  30. 290 pokel2,so :pokel2+cm,c1
  31. 300 g=a(m)
  32. 310 h=peek(l3)
  33. 320 ifm=0orm=2orm=4orm=6then360
  34. 330 ifh=a(1)andg=a(3)theng=cr
  35. 340 ifh=crtheng=cr
  36. 350 ifh=a(3)andg=a(1)theng=cr
  37. 360 pokel3,g:pokel3+cm,co:  u1=u2:v1=v2
  38. 370 pokev,15:pokeaa,88:pokeph,15:pokepl,15:pokess,89
  39. 380 pokehf,h(m):pokelf,l(m):pokew,65:
  40. 390 nexti:rem@ p
  41. 400 pokew,0
  42. 410 pokel2,oh :pokel2+cm,c1
  43. 420 rem place  the players
  44. 430 fori=0to1
  45. 440 gosub520
  46. 450 ifpeek(l1)><ohthen440
  47. 460 pokel1,p(i):o(i)=u1:d(i)=v1
  48. 470 pokel1+54272,co(i)
  49. 480 nexti
  50. 490 pn=0
  51. 500 goto620
  52. 510 wait197,64:return
  53. 520 u1=int(rnd(ti)*20)*2
  54. 530 v1=int(rnd(ti)*11)*2
  55. 540 l1=s+u1+v1*40
  56. 550 return
  57. 560 pokes+55208,14
  58. 570 print"";:fori=1to23:print"";:next:return
  59. 580 print"player ";chr$(49+pn);" token    your move?        "
  60. 590 for i=1to 10:get k$:next
  61. 600 pokes+936,p(pn):pokes+55208,co(pn)
  62. 610 return
  63. 620 rem can the current player move?
  64. 630 l1=s+o(pn)+d(pn)*40:f1=0
  65. 640 forj=0to7
  66. 650 u2=d(pn)+b(j)
  67. 660 v2=o(pn)+c(j)
  68. 670 ifv2<0orv2>38then730
  69. 680 ifu2<0oru2>20then730
  70. 690 ifpeek(s+u2*40+v2)><ohthen730
  71. 700 l2=l1+b(j)*20+c(j)/2
  72. 710 ifpeek(l2)=a(j)thenf1=1:j=7:goto730
  73. 720 ifpeek(l2)=crthenf1=1:j=7:goto730
  74. 730 nextj
  75. 740 iff1=0then1210
  76. 750 gosub560
  77. 760 gosub580
  78. 770 geta$:ifa$=""then770
  79. 780 ifa$="q"then1190
  80. 790 ifa$="r"thena$="7"
  81. 800 ifa$="t"thena$="0"
  82. 810 ifa$="y"thena$="1"
  83. 820 ifa$="f"thena$="6"
  84. 830 ifa$="h"thena$="2"
  85. 840 ifa$="v"thena$="5"
  86. 850 ifa$="b"thena$="4"
  87. 860 ifa$="n"thena$="3"
  88. 870 ifa$<"0"ora$>"7"thengosub1150:goto750
  89. 880 m=val(a$):fori=1to10:geta$:nexti
  90. 890 u2=d(pn)+b(m):v2=o(pn)+c(m)
  91. 900 ifu2<0oru2>20thengosub1150:goto750
  92. 910 ifv2<0orv2>38thengosub1150:goto750
  93. 920 l2=s+u2*40+v2
  94. 930 ifpeek(l2)<>ohthengosub1150:goto750
  95. 940 l3=l1+b(m)*20+c(m)/2
  96. 950 c9=peek(l3):ifc9=crorc9=a(m)then970
  97. 960 gosub1150:goto750
  98. 970 rem make the move
  99. 980 pokel2,p(pn):pokel2+54272,co(pn)
  100. 990 pokel1,oh:f2=0:pokel1+54272,c1
  101. 1000 pokev,15:pokeaa,88:pokeph,15:pokepl,15:pokess,89
  102. 1010 pokehf,h(m):pokelf,l(m):pokew,65:for tm=1to100:next: pokew,0
  103. 1020 ifpeek(l3)=cranda(m)=a(1)thenpokel3,a(3):goto1050
  104. 1030 ifpeek(l3)=cranda(m)=a(3)thenpokel3,a(1):goto1050
  105. 1040 pokel3,32
  106. 1050 forj=0to7
  107. 1060 v3=o(pn)+c(j)/2:ifv3<0orv3>38then1100
  108. 1070 u3=d(pn)+b(j)/2:ifu3<0oru3>20then1100
  109. 1080 q=peek(s+v3+u3*40)
  110. 1090 ifq=a(j)orq=crthenf2=1:j=7
  111. 1100 nextj
  112. 1110 iff2=0thenpokel1,32
  113. 1120 o(pn)=v2:d(pn)=u2
  114. 1130 pn=1-pn
  115. 1140 goto630
  116. 1150 gosub560
  117. 1160 print"can't go there                        "
  118. 1170 gosub510
  119. 1180 return
  120. 1190 gosub560:print"player "chr$(pn+49)" gives up!           "
  121. 1200 goto1230
  122. 1210 gosub560
  123. 1220 print"player ";chr$(pn+49);" cannot move           "
  124. 1230 gosub510
  125. 1240 ww=1-pn:ll=pn
  126. 1250 gosub560
  127. 1260 v(ww)=v(ww)+1
  128. 1270 print"player ";chr$(ww+49)" has won!  press ctrl...":wait653,4
  129. 1280 gosub510
  130. 1290 gosub560
  131. 1300 print"space to play again/q to quit"                   "
  132. 1310 [161]a$:[139]a$[179][177]" "[175]a$[179][177]"q"[167]1310
  133. 1320 [139]a$[178]" "[167][138]
  134. 1330 [137]1730
  135. 1340 [153]"load":[153][163]14);"opengraphbusters!"
  136. 1350 [153]:[153][163]13);"printby robert rossa"
  137. 1360 [153]
  138. 1370 [153]"sys each time you move, the path you"
  139. 1380 [153]" used disappears.  you win when your"
  140. 1390 [153]" opponent can't move.  use the keys"
  141. 1400 [153]" surrounding the 'g' key to move."
  142. 1410 [153]"open ex. t= north, b= south, v= southeast.sys"
  143. 1420 [153]
  144. 1430 [153][163]12)"     r t y"
  145. 1440 [153][163]12)"      (NULL)(NULL)(NULL) "
  146. 1450 [153][163]12)"     ftan(NULL)tanh"
  147. 1460 [153][163]12)"      (NULL)(NULL)(NULL) "
  148. 1470 [153][163]12)"     v b n"
  149. 1480 [153]
  150. 1490 [153]
  151. 1500 [153]"press space to start"
  152. 1510 [161] a$:[139]a$[178]""[167]1510
  153. 1520 [142]
  154. 1530 [153]"load           (NULL)(NULL)atnstr$(NULL)(NULL)atn(NULL) (NULL)(NULL)val(NULL)val(NULL)(NULL)(NULL)"
  155. 1540 a$[178]"sysget*rndwaitgetget*rndwaitgetget*rndwaitgetget*rndwaitgetgetwaitgetgetwaitget"
  156. 1550 b$[178]"sysgetwaitgetnewrndget *waitcosget*rndwaitgetgetlogcoswaitgetget*rndwaitget"
  157. 1560 c$[178]"sysgetlogcoswaitgetgetwaitgetrndwaitrndgetwaitgetgetwaitgetgetwaitget  getwaitgetgetwaitget"
  158. 1570 d$[178]"sys                    ":x$[178][199](13):x[178] 10:[141]1620
  159. 1580 a$[178]"sysget*rndwaitgetgetwaitgetgetwaitgetget*newwaitcoslogrnd*waitcosget*newwaitcosget*rndwaitgetget*newwaitcos getwaitget "
  160. 1590 b$[178]"sysget*rndwaitrndgetwaitgetgetwaitgetlognewrndwaitget getwaitget get*waitcos get *waitcoslognewrndwaitget getwaitget "
  161. 1600 c$[178]"sysgetlogcoswaitgetgetlogcoswaitget*newcoswaitget getwaitget getlogwaitnewrndgetwaitgetrndwaitrnd*newcoswaitget    "
  162. 1610 d$[178]"sys                             logcos ":x[178] 5:[141]1620 :[137]1640
  163. 1620 [151]53280,6:[151]53281,0:[153][166]x)a$x$[166]x)b$x$[166]x)c$x$[166]x)d$
  164. 1630 [142]
  165. 1640 [153]"            peeky (NULL)obert (NULL)ossa sys"
  166. 1650 [153],"ortantantantantantantantantantantantantantantantantantantan^"
  167. 1660 [153],"(NULL) (NULL)pace (NULL)o lenontinuesys (NULL)"
  168. 1670 [153],"/tantantantantantantantantantantantantantantantantantantanexp"
  169. 1680 [153],"ortantantantantantantantantantantantantantantantantantantan^"
  170. 1690 [153],"(NULL)  (NULL) for (NULL)(NULL)atnstr$(NULL)(NULL)atn(NULL)   sys(NULL)"
  171. 1700 [153],"/tantantantantantantantantantantantantantantantantantantanexp"
  172. 1710 [161]a$:[139]a$[179][177]" "[175]a$[179][177]"q"[167]1710
  173. 1720 [139]a$[178]" "[167][151]53272,21:[142]
  174. 1730 [159]15,8,15,"r0:hello connect=hello connect":[132]15,er:[160]15
  175. 1740 [139] er[179][177]63 [167] [153]"load":[128]
  176. 1750 a$[178]"hello connect":q$[178][199](34)
  177. 1760 [153]"stoploadload"q$a$q$",8"
  178. 1770 [153]"r(NULL)":[151]631,13:[151]632,13:[151]198,2:[128]
  179.