home *** CD-ROM | disk | FTP | other *** search
/ Rockford Magazine / Rockford_Magazine_026_19xx_-_de_Disk_1_of_2_Side_B.d64 / quadrato (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  8KB  |  302 lines

  1. 1 rem *********************************
  2. 2 rem *      q u a d r a t o          *
  3. 3 rem * 1987 - c64 version f. brall   *
  4. 4 rem * ein taktik u. strategie spiel *
  5. 5 rem * fuer kassette und diskette    *
  6. 6 rem *********************************
  7. 7 rem * highscoretabelle nur auf disk *
  8. 8 rem *********************************
  9. 9 poke 56,144
  10. 10 dim brett (9,9):rem spielfeld
  11. 11 dim fenster (3,3):rem fenster
  12. 12 dim hn$(9):rem highscore name
  13. 13 dim hs (9):rem highscore punkte
  14. 20 farbram=55296
  15. 25 poke 53281,0:poke 53280,2
  16. 27 gosub 30000: rem copyright
  17. 30 gosub 22000: rem highscore init
  18. 40 :
  19. 80 cx=1:cy=1:rem cursorposition
  20. 85 quatrate = 20
  21. 100 s=0:rem score=0
  22. 103 p=1:rem picture=1
  23. 104 ba=5:rem bonusabzug
  24. 105 gosub 17000:rem bildschirm init
  25. 107 gosub 24000:rem sortiere
  26. 108 gosub 23000:rem highscoretabelle
  27. 110 b=2000:rem bonus score
  28. 111 n=0:rem flag fuer neues bild
  29. 115 gosub 10000:rem zeichne brett
  30. 120 gosub 11000:rem zeichne fenster
  31. 150 gosub 14000:rem zufallsfeld
  32. 160 gosub 15000:rem uebernehme fenster
  33. 170 gosub 16000:rem joystick/cursor
  34. 450 b=b-ba:if b<0 then b=0
  35. 455 poke 54296,15:poke 54276,0:poke 54273,30:poke 54277,5:poke 54276,17
  36. 490 if (j and 16)=0 then gosub 19000
  37. 500 gosub 18000:rem zeige bonus
  38. 504 if n=1then poke54296,15:poke 54276,0:poke54273,40:poke54277,10:poke 54276,17
  39. 505 if n=1 then p=p+1:quatrate=quatrate+1:ba=ba+1:goto 110
  40. 510 if b>0 then 170
  41. 511 poke 54276,0:for f=250 to 30 step -8
  42. 512 for i=1 to 10 :next i
  43. 513 poke54296,15:poke54273,f :poke54277,11:poke 54276,17
  44. 514 next f
  45. 515 gosub 24000:rem sortiere
  46. 520 gosub 23000:rem highscoretabelle
  47. 600 print"[159] another game y/n  "
  48. 610 get e$:if e$="" then 610
  49. 620 if e$="y" then 80
  50. 630 if e$="n" then 650
  51. 640 goto 610
  52. 650 print"[147] dieses tronic-programm gibt es"
  53. 660 print" auch fuer den atari,c16 und ibm pc !"
  54. 670 print"[159] c64/c16/ibm version bei f.brall"
  55. 680 end
  56. 10000 rem zeige brett
  57. 10010 print"[158][176][195][178][195][178][195][178][195][178][195][178][195][178][195][178][195][178][195][174]"
  58. 10015 for i= 1 to 8
  59. 10020 print"[194] [194] [194] [194] [194] [194] [194] [194] [194] [194]"
  60. 10030 print"[171][195][219][195][219][195][219][195][219][195][219][195][219][195][219][195][219][195][179]"
  61. 10035 next i
  62. 10040 print"[194] [194] [194] [194] [194] [194] [194] [194] [194] [194]"
  63. 10050 print"[173][195][177][195][177][195][177][195][177][195][177][195][177][195][177][195][177][195][189]"
  64. 10051 print"[159]     picture:"p
  65. 10052 for y= 1 to 9:for x=1 to 9:brett(x,y)=0:next x,y
  66. 10055 return
  67. 10060 :
  68. 11000 rem zeige fenster
  69. 11005 print"";
  70. 11010 printtab(23)"[176][195][178][195][178][195][174]"
  71. 11015 for i= 1 to 2
  72. 11020 printtab(23)"[194] [194] [194] [194]"
  73. 11030 printtab(23)"[171][195][219][195][219][195][179]"
  74. 11035 next i
  75. 11040 printtab(23)"[194] [194] [194] [194]"
  76. 11050 printtab(23)"[173][195][177][195][177][195][189]"
  77. 11052 for y= 1 to 3:for x=1 to 3:fenster(x,y)=0:next x,y
  78. 11055 return
  79. 11060 :
  80. 12000 rem setze stein (variable x,y)
  81. 12010 print"";
  82. 12012 brett(x,y)=1
  83. 12015 if y=1 then 12030
  84. 12020 for i=1 to y-1:print"";:next i
  85. 12030 print tab((1+(x-1)*2))" [146]"
  86. 12040 return
  87. 12050 :
  88. 13000 rem setze fensterstein (var x,y)
  89. 13010 print"";
  90. 13012 fenster(x,y)=1
  91. 13015 if y=1 then 13030
  92. 13020 for i=1 to y-1:print"";:next i
  93. 13030 print tab((24+(x-1)*2))" [146]"
  94. 13040 return
  95. 13050 :
  96. 14000 rem zufallsfeld
  97. 14010 for t= 1 to quatrate
  98. 14020 x=int(rnd(1)*9)+1
  99. 14030 y=int(rnd(1)*9)+1
  100. 14040 gosub 12000
  101. 14050 next t
  102. 14060 return
  103. 14070 :
  104. 15000 rem uebernehme in fenster
  105. 15020 xf=int(rnd(1)*7)+1
  106. 15030 yf=int(rnd(1)*7)+1
  107. 15040 for y= 1 to 3
  108. 15050 for x= 1 to 3
  109. 15060 if brett(xf+x-1,yf+y-1)=1 then gosub 13000
  110. 15070 next x:next y
  111. 15080 return
  112. 15090 :
  113. 16000 rem bewege cursor (joystick)
  114. 16020 poke 56322,244
  115. 16025 j=peek(56320)
  116. 16028 if (j and 15)= 15 then 16140
  117. 16030 sys 49152,cy,cx,7:rem cursor loeschen
  118. 16040 if (j and 1)=0 then cy=cy-1
  119. 16050 if (j and 2)=0 then cy=cy+1
  120. 16060 if (j and 4)=0 then cx=cx-1
  121. 16070 if (j and 8)=0 then cx=cx+1
  122. 16100 if cx>7 then cx=7
  123. 16110 if cx<1 then cx=1
  124. 16120 if cy>7 then cy=7
  125. 16130 if cy<1 then cy=1
  126. 16140 sys 49152,cy,cx,8
  127. 16150 poke 56322,255:return
  128. 16160 :
  129. 17000 rem bildschirm initialisieren
  130. 17005 print"[147][158]quadrato"
  131. 17006 print"[158]1987 bei"
  132. 17007 print"[158] f.brall"
  133. 17010 print"[156]highscore :[160]"
  134. 17020 print"bonusscore:[160]"
  135. 17030 print"your score:[160]"
  136. 17100 gosub 20000
  137. 17300 return
  138. 17310 :
  139. 18000 rem zeige bonus
  140. 18010 print"     [157][157][157][157][157]"b
  141. 18100 return
  142. 18110 :
  143. 19000 rem fenster vergleichen
  144. 19005 u=0
  145. 19010 for y=0 to 2
  146. 19015 for x=0 to 2
  147. 19020 if brett(cx+x,cy+y)<>fenster(x+1,y+1) then u=1
  148. 19030 next x:next y
  149. 19040 if u=1 then  s=s-b:n=0
  150. 19060 if u=0 then  s=s+b:n=1
  151. 19070 if u=1thenpoke54296,15:poke54276,0:poke54273,60:poke54277,10:poke54276,17
  152. 19080 gosub 20000
  153. 19100 return
  154. 19110 :
  155. 20000 rem zeige score
  156. 20010 print"     [157][157][157][157][157]"s
  157. 20100 return
  158. 20110 :
  159. 21000 rem *****************************
  160. 21001 rem * dieses unterprogramm er-  *
  161. 21002 rem * stellt die disketten high-*
  162. 21003 rem * scoretabelle.             *
  163. 21004 rem *****************************
  164. 21010 open 1,8,2,"@:qscr,s,w"
  165. 21011 for i= 1 to 9
  166. 21020 print#1,"frank        "
  167. 21024 print#1,i*3500
  168. 21030 next i
  169. 21040 close 1
  170. 21050 print"highscoretabelle wurde erstellt !"
  171. 21060 return
  172. 21070 :
  173. 22000 rem highscore init/laden
  174. 22010 if peek(186)=8 then 22100
  175. 22015 for i= 1 to 9
  176. 22020 hn$(i)="frank        "
  177. 22024 hs(i)=i*3500
  178. 22030 next i
  179. 22040 return
  180. 22090 :
  181. 22100 open 1,8,2,"qscr,s,r"
  182. 22110 for i= 1 to 9
  183. 22120 input#1,hn$(i)
  184. 22130 input#1,hs(i)
  185. 22140 next i
  186. 22150 close 1
  187. 22160 return
  188. 22170 :
  189. 23000 rem highscoretabelle anzeigen
  190. 23010 print"":print tab(20)" highscoretabelle  [154]"
  191. 23050 for i=1 to 8
  192. 23060 print tab(19)i"[157]. "left$(hn$(i),9);""hs(i)
  193. 23070 next i
  194. 23100 return
  195. 23110 :
  196. 24000 rem sortiere highscore
  197. 24010 hn$(9)="!"
  198. 24020 hs(9)=s
  199. 24030 for i=1 to 9
  200. 24040 for t=1 to 9
  201. 24050 if hs(t)<hs(i) then gosub 24500
  202. 24060 next t:next i
  203. 24070 hs=hs(1):rem highscore
  204. 24080 gosub 25000
  205. 24100 for i= 1 to 8
  206. 24110 if hn$(i)<>"!" then 24130
  207. 24120 print"[158] name: ";
  208. 24122 input hn$(i):hn$(i)=hn$(i)+"              "
  209. 24125 gosub 26000:rem save highscore
  210. 24130 next i
  211. 24300 return
  212. 24310 :
  213. 24500 ms=hs(i):m$=hn$(i)
  214. 24510 hs(i)=hs(t):hn$(i)=hn$(t)
  215. 24520 hs(t)=ms:hn$(t)=m$
  216. 24530 return
  217. 24540 :
  218. 25000 rem zeige highscore
  219. 25010 print"     [157][157][157][157][157]"hs
  220. 25100 return
  221. 25110 :
  222. 26000 rem save highscore
  223. 26005 if peek(186)=1 then return
  224. 26010 open 1,8,2,"@:qscr,s,w"
  225. 26020 for i=1 to 9
  226. 26030 print#1,hn$(i)
  227. 26040 print#1,hs(i)
  228. 26050 next i
  229. 26060 close 1
  230. 26070 return
  231. 26080 :
  232. 30000 rem anfangsbild initialisierung
  233. 30010 print"[147][158]            q u a d r a t o"
  234. 30020 print"          c64 version f. brall"
  235. 30030 print"               (c) 1987"
  236. 30040 print"      bitte warten ich poke daten !"
  237. 30500 gosub 40000:rem music init
  238. 30510 gosub 60000:rem cursor mc-routine
  239. 30515 print"[159]       press any key to continue       "
  240. 30516 poke 198,0
  241. 30517 get e$:if e$="" then 30517
  242. 30518 sys 40752
  243. 30520 return
  244. 30530 :
  245. 40000 rem *** music initialisieren ***
  246. 40001 :
  247. 40002 dimh(75):fori=0to9
  248. 40003 h(48+i)=i:h(65+i)=i+10:next
  249. 40004 fori= 40474 to 40953 :reada$
  250. 40005 h=asc(left$(a$,1))
  251. 40006 l=asc(right$(a$,1))
  252. 40007 d=h(h)*16+h(l):s=s+d:pokei,d
  253. 40008 a=a+1:ifa<20thennext:a=-1
  254. 40009 readv:z=z+1:ifv=sthen40011
  255. 40010 print"datafehler in zeile :";40013+z:end
  256. 40011 ifa<0then40013
  257. 40012 s=0:a=0:next
  258. 40013 sys 40704 :return
  259. 40014 data 00,00,00,00,08,00,0a,65,00,00,00,00,00,0b,50,00,00,00,00,00, 210
  260. 40015 data 00,f0,00,00,00,00,00,a2,0e,14,a2,0e,28,6d,10,14,67,11,28,ed, 1194
  261. 40016 data 15,14,89,13,14,a2,0e,28,67,11,28,45,1d,14,45,1d,28,45,1d,14, 967
  262. 40017 data 14,1a,1e,ed,15,0a,89,13,14,ed,15,64,45,1d,14,45,1d,28,45,1d, 1232
  263. 40018 data 14,14,1a,1e,ed,15,0a,89,13,1d,89,13,01,a2,0e,14,a2,0e,0a,a2, 1250
  264. 40019 data 0e,14,67,11,28,a2,0e,14,a2,0e,28,ed,15,14,ed,15,14,89,13,1e, 1348
  265. 40020 data 67,11,0a,a2,0e,64,00,f7,0a,50,0a,0d,3c,a2,0e,3c,67,11,3c,ed, 1479
  266. 40021 data 15,3c,cf,22,3c,6d,10,78,f7,0a,3c,0a,0d,3c,a2,0e,3c,67,11,3c, 1443
  267. 40022 data f7,0a,3c,6d,10,3c,f7,0a,78,00,00,b5,08,50,f8,0a,3c,4f,0c,3c, 1617
  268. 40023 data a3,0e,3c,d0,22,3c,ee,15,3c,c5,09,78,b5,08,3c,f8,0a,3c,4f,0c, 1842
  269. 40024 data 3c,a3,0e,3c,f8,0a,3c,6e,10,3c,f8,0a,32,f8,0a,0a,6e,10,0a,68, 1617
  270. 40025 data 11,0a,6e,10,0a,f8,0a,0a,00,00,a9,01,8d,15,9e,8d,10,9e,8d,11, 1394
  271. 40026 data 9e,a9,fd,8d,12,9e,8d,13,9e,8d,14,9e,a2,18,bd,1b,9e,9d,00,d4, 2463
  272. 40027 data ca,10,f7,78,a9,48,8d,14,03,a9,9f,8d,15,03,58,60,60,60,a2,18, 2045
  273. 40028 data a9,00,9d,00,d4,ca,10,fa,78,a9,31,8d,14,03,a9,ea,8d,15,03,58, 2164
  274. 40029 data 60,60,a9,0f,8d,18,d4,ea,ce,15,9e,d0,48,ee,12,9e,ee,12,9e,ee, 2718
  275. 40030 data 12,9e,ad,12,9e,c9,63,f0,20,aa,a9,40,8d,04,d4,bd,35,9e,8d,00, 2398
  276. 40031 data d4,bd,36,9e,8d,01,d4,bd,37,9e,8d,15,9e,a9,41,8d,04,d4,18,90, 2448
  277. 40032 data 18,a9,fd,8d,12,9e,8d,13,9e,8d,14,9e,a9,01,8d,15,9e,8d,10,9e, 2205
  278. 40033 data 8d,11,9e,d0,5a,ce,10,9e,d0,28,a9,20,8d,0b,d4,ee,13,9e,ee,13, 2479
  279. 40034 data 9e,ee,13,9e,ae,13,9e,bd,99,9e,8d,07,d4,bd,9a,9e,8d,08,d4,bd, 2835
  280. 40035 data 9b,9e,8d,10,9e,a9,21,8d,0b,d4,ce,11,9e,d0,28,a9,10,8d,12,d4, 2379
  281. 40036 data ee,14,9e,ee,14,9e,ee,14,9e,ae,14,9e,bd,c5,9e,8d,0e,d4,bd,c6, 2898
  282. 40037 data 9e,8d,0f,d4,bd,c7,9e,8d,11,9e,a9,11,8d,12,d4,4c,31,ea,00,7f, 2431
  283. 60000 rem cursor mc-routine init
  284. 60005 fori=0to9
  285. 60010 h(48+i)=i:h(65+i)=i+10:next
  286. 60020 fori= 49152 to 49263 :reada$
  287. 60030 h=asc(left$(a$,1))
  288. 60040 l=asc(right$(a$,1))
  289. 60050 d=h(h)*16+h(l):s=s+d:pokei,d
  290. 60060 a=a+1:ifa<20thennext:a=-1
  291. 60070 readv:z=z+1:ifv=sthen60085
  292. 60080 print"datafehler in zeile :";60200+z:end
  293. 60085 ifa<0then60100
  294. 60090 s=0:a=0:next
  295. 60100 return
  296. 60201 data 20,fd,ae,20,9e,b7,a9,00,85,f9,a9,d8,85,fa,18,a5,f9,69,50,85, 2907
  297. 60202 data f9,a5,fa,69,00,85,fa,ca,d0,f0,20,fd,ae,20,9e,b7,18,a5,f9,69, 3177
  298. 60203 data 02,85,f9,a5,fa,69,00,85,fa,ca,d0,f0,38,a5,f9,e9,29,85,f9,a5, 3228
  299. 60204 data fa,e9,00,85,fa,20,fd,ae,20,9e,b7,86,fb,a2,05,a0,04,b1,f9,29, 2881
  300. 60205 data 0f,c9,06,f0,04,a5,fb,91,f9,88,10,f1,18,a5,f9,69,28,85,f9,a5, 2799
  301. 60206 data fa,69,00,85,fa,ca,d0,df,60,ce,08,29, 1722
  302.