home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disc 33 / Commodore_Disc_33_19xx_-_de.d64 / puzzle (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  8KB  |  442 lines

  1. 10 rem *************************
  2. 20 rem puzzle                ***
  3. 30 rem                       ***
  4. 40 rem ein programm          ***
  5. 50 rem     fuer den c64      ***
  6. 60 rem                       ***
  7. 70 rem (c) by g. kramer      ***
  8. 80 rem        4407 emsdetten ***
  9. 90 rem *************************
  10. 100 ifa=1then130
  11. 110 a=1
  12. 120 load"mp puzzle",8,1
  13. 130 gosub300
  14. 140 gosub710
  15. 150 ifs=0then260
  16. 160 gosub1130
  17. 170 gosub1580
  18. 180 poke198,0
  19. 190 geta$:ifa$=""then190
  20. 200 gosub3870
  21. 210 r=0:fori=1to2
  22. 220 bo(i)=0:forj=0to1
  23. 230 ms(i,j)=0:nextj,i
  24. 240 printchr$(158)chr$(147)
  25. 250 gosub920:ifs>0then160
  26. 260 sys50256:end
  27. 270 rem ********************
  28. 280 rem *** anfangswerte ***
  29. 290 rem ********************
  30. 300 poke247,0:poke248,0
  31. 310 poke249,249:poke250,249
  32. 320 poke2,0:sys12*4096
  33. 330 poke53281,0
  34. 340 printchr$(144)chr$(147)
  35. 350 b=1024:f=55296
  36. 360 ze=214:sp=211:cu=58640
  37. 370 dima$(6),t(32,4)
  38. 380 dimms(2,1)
  39. 390 dimbo(2)
  40. 400 dimhs$(20),hs(20)
  41. 410 jt=6:poke49257,jt
  42. 420 gosub3040
  43. 430 gosub3330
  44. 440 return
  45. 450 rem ************************
  46. 460 rem *** ausgeben zeichen ***
  47. 470 rem ************************
  48. 480 fori=0to4:forj=atoa+160step40
  49. 490 pokeb+i+j,32:pokef+i+j,a1
  50. 500 nextj,i
  51. 510 fori=0to4
  52. 520 a0=int(t(a2,i)/5)
  53. 530 a3=t(a2,i)-5*a0
  54. 540 pokeb+a+a3+40*a0,224
  55. 550 next
  56. 560 return
  57. 570 rem *********************
  58. 580 rem *** kessel auf/zu ***
  59. 590 rem *********************
  60. 600 a1=peek(f+a-1)
  61. 610 fori=atoi+11
  62. 620 pokef+i,a1:pokeb+i,a0
  63. 630 next
  64. 640 fori=a+2toi-200step-40
  65. 650 pokef+i,a1:pokef+i+6,a1
  66. 660 pokeb+i,a0:pokeb+i+6,a0
  67. 670 next:return
  68. 680 rem *************
  69. 690 rem *** titel ***
  70. 700 rem *************
  71. 710 printchr$(144)chr$(147)
  72. 720 pokeze,0:pokesp,0:syscu
  73. 730 gosub2620
  74. 740 fori=0to6
  75. 750 printspc(7)a$(i):next
  76. 760 fori=1to500
  77. 770 a=40*int(7*rnd(0))
  78. 780 a=a+int(26*rnd(0))+7
  79. 790 pokef+a,2+int(13*rnd(0)):next
  80. 800 fori=0to6:forj=7to32
  81. 810 a=f+j+40*i
  82. 820 if(peek(a)and15)=0thenpokea,7
  83. 830 nextj,i
  84. 840 printchr$(30)
  85. 850 pokeze,10:pokesp,0:syscu
  86. 860 printspc(12)"ein programm von"
  87. 870 print:printchr$(153)
  88. 880 printspc(16)"g.kramer"
  89. 890 fori=567to592
  90. 900 pokef+i,4:pokeb+i,111
  91. 910 next
  92. 920 print:print
  93. 930 print"bitte eingeben:"
  94. 940 print
  95. 950 print"1-2=anzahl spieler"
  96. 960 print
  97. 970 print"  3=highscore zeigen"
  98. 980 print
  99. 990 print"  0=ende";
  100. 1000 poke198,0:s=0
  101. 1010 geta$:ifa$="0"then1090
  102. 1020 ifa$="3"thengosub3620:goto1050
  103. 1030 ifa$="4"thengosub3870:goto1050
  104. 1040 goto1060
  105. 1050 printchr$(147):goto840
  106. 1060 ifa$<"1"ora$>"2"then1010
  107. 1070 s=val(a$)
  108. 1080 ss=sor1
  109. 1090 return
  110. 1100 rem *********************
  111. 1110 rem *** bild aufbauen ***
  112. 1120 rem *********************
  113. 1130 printchr$(31)chr$(147);
  114. 1140 ba=1
  115. 1150 ifs=1thenba=11
  116. 1160 pa=ba+200
  117. 1170 a$=chr$(32)+chr$(32)+chr$(146)
  118. 1180 a0$=left$(a$,2)
  119. 1190 fori=1to6
  120. 1200 a$=a$+chr$(32)+chr$(32)
  121. 1210 a0$=a0$+chr$(32)+chr$(32)
  122. 1220 next
  123. 1230 a$=a$+chr$(18)+chr$(32)+chr$(32)
  124. 1240 a0$=a0$+right$(a$,2)
  125. 1250 fori=5to19
  126. 1260 pokeze,i:pokesp,ba:syscu
  127. 1270 printchr$(18)chr$(28)a$spc(6);
  128. 1280 ifs=2thenprintchr$(31)a$
  129. 1290 next
  130. 1300 fori=20to21
  131. 1310 pokeze,i:pokesp,ba:syscu
  132. 1320 printchr$(18)chr$(28)a0$spc(6);
  133. 1330 ifs=2thenprintchr$(31)a0$
  134. 1340 next
  135. 1350 return
  136. 1360 rem ***********************
  137. 1370 rem *** punkte ausgeben ***
  138. 1380 rem ***********************
  139. 1390 fori=1tos:forj=0to1
  140. 1400 pokeze,22:pokesp,0:syscu
  141. 1410 ifms(i,j)=0then1490
  142. 1420 a$=chr$(146)+chr$(164)+chr$(164)
  143. 1430 a$=a$+a$+a$:a=ba+i*22-22+j*10
  144. 1440 ifj=1thena$="bonus"
  145. 1450 printchr$(158)spc(a)a$
  146. 1460 a$=right$("     "+str$(ms(i,j)),6)
  147. 1470 printspc(a)chr$(18)a$
  148. 1480 goto1530
  149. 1490 a$=chr$(146)+chr$(32)+chr$(32)
  150. 1500 a$=a$+a$+a$:a=ba+i*22-22+j*10
  151. 1510 printspc(a)a$
  152. 1520 printspc(a)a$
  153. 1530 nextj,i
  154. 1540 return
  155. 1550 rem *************
  156. 1560 rem *** spiel ***
  157. 1570 rem *************
  158. 1580 r=r+1:a$=str$(r)
  159. 1590 pokeze,8:pokesp,ba+21-len(a$)
  160. 1600 syscu
  161. 1610 printchr$(146)chr$(156)a$
  162. 1620 a=pa+2:a0=102:gosub600
  163. 1630 ifs=2thena=pa+24:gosub600
  164. 1640 a1=int(11*rnd(0))+3
  165. 1650 ifa1=6thena1=7
  166. 1660 a2=33:ifr>100thena2=12
  167. 1670 a2=int(33*rnd(0))
  168. 1680 fork=1tos:a=ba+22*k-17
  169. 1690 if(ssandk)>0thengosub480:goto1720
  170. 1700 pokesp,a+1:pokeze,2:syscu
  171. 1710 printchr$(156)"ende"
  172. 1720 next
  173. 1730 gosub1390
  174. 1740 poke251,ba+5:poke252,4
  175. 1750 poke253,ba+5:poke254,200
  176. 1760 poke2,ss
  177. 1770 poke250,249:poke249,249
  178. 1780 poke248,4
  179. 1790 ti$="000000":x=50
  180. 1800 poke249,x
  181. 1810 a$=str$(249-x)
  182. 1820 pokeze,10:pokesp,ba+21-len(a$)
  183. 1830 syscu
  184. 1840 printchr$(146)chr$(28)a$
  185. 1850 a=peek(2)
  186. 1860 if(aand5)<>4then1880
  187. 1870 ms(1,1)=249-x:poke2,peek(2)and10
  188. 1880 if(aand10)<>8then1900
  189. 1890 ms(2,1)=249-x:poke2,peek(2)and5
  190. 1900 gosub1390
  191. 1910 geta$:ifa$=chr$(133)then1950
  192. 1920 ifa$<>chr$(134)then1970
  193. 1930 jt=jt+1:ifjt>50thenjt=50
  194. 1940 goto1960
  195. 1950 jt=jt-1:ifjt=0thenjt=1
  196. 1960 poke49257,jt
  197. 1970 ifpeek(2)=0then2000
  198. 1980 x=x+1+int(r/50):ifx>249thenx=249
  199. 1990 goto1800
  200. 2000 poke249,249
  201. 2010 if(ssor1)=0then2060
  202. 2020 fori=51203+batoi+9step2
  203. 2030 a=peek(i)+256*peek(i+1)
  204. 2040 ifa<1224thenss=ssand2
  205. 2050 next
  206. 2060 if(ssor2)=0then2110
  207. 2070 fori=51225+batoi+9step2
  208. 2080 a=peek(i)+256*peek(i+1)
  209. 2090 ifa<1224thenss=ssand1
  210. 2100 next
  211. 2110 fori=1tos
  212. 2120 if(ssandi)>0then2180
  213. 2130 pokeze,21:pokesp,0:syscu
  214. 2140 a=ba+i*22-17
  215. 2150 a$=chr$(32)+"ende"+chr$(32)
  216. 2160 printchr$(18)spc(a)a$chr$(146)
  217. 2170 ms(i,1)=0
  218. 2180 next:gosub1390
  219. 2190 ifss=0then2580
  220. 2200 a$="0"
  221. 2210 fork=1tos
  222. 2220 fori=ba+740+k*22toi-520step-40
  223. 2230 forj=0to11
  224. 2240 a=peek(b+i+j)
  225. 2250 ifa<>160thenj=19
  226. 2260 next
  227. 2270 ifj=20then2390
  228. 2280 forl=0to16
  229. 2290 forj=0to11
  230. 2300 pokef+i+j,l
  231. 2310 nextj,l
  232. 2320 poke167,(b+i)and255
  233. 2330 poke168,(b+i)/256
  234. 2340 gosub1390
  235. 2350 sys50179
  236. 2360 ms(k,1)=ms(k,1)+200
  237. 2370 gosub1390
  238. 2380 i=i+40:a$="1"
  239. 2390 nexti,k
  240. 2400 ifa$="1"then2200
  241. 2410 fori=1tos
  242. 2420 ms(i,0)=ms(i,0)+ms(i,1)
  243. 2430 ms(i,1)=0
  244. 2440 next:gosub1390
  245. 2450 fori=1tos
  246. 2460 a=int(ms(i,0)/5000)
  247. 2470 ifa=bo(i)then2560
  248. 2480 bo(i)=a
  249. 2490 fork=0to16
  250. 2500 forj=ba+740+i*22toj+11
  251. 2510 pokef+j,k
  252. 2520 nextj,k
  253. 2530 poke167,(b+j-12)and255
  254. 2540 poke168,(b+j-12)/256
  255. 2550 sys50179
  256. 2560 next
  257. 2570 goto1580
  258. 2580 return
  259. 2590 rem *******************
  260. 2600 rem *** datas titel ***
  261. 2610 rem *******************
  262. 2620 a=peek(61)+256*peek(62)
  263. 2630 poke65,aand255
  264. 2640 poke66,a/256
  265. 2650 fori=0to6
  266. 2660 ifi<>2then2680
  267. 2670 a$(2)=a$(1):goto2770
  268. 2680 reada:a$(i)=chr$(18)
  269. 2690 forj=1toa
  270. 2700 reada:ifa>17then2750
  271. 2710 fork=1toa
  272. 2720 a$(i)=a$(i)+chr$(32)
  273. 2730 next
  274. 2740 goto2760
  275. 2750 a$(i)=a$(i)+chr$(a)
  276. 2760 next
  277. 2770 next
  278. 2780 return
  279. 2790 : 1. zeile
  280. 2800 data2,3,127
  281. 2810 : 2.+3. zeile
  282. 2820 data9,32,146,2,18,32,146,16,18,32
  283. 2830 : 4. zeile
  284. 2840 data32,3,146,169,32,18,32,146,2
  285. 2850 data18,32,146,32,18,169,2,146,169
  286. 2860 data32,18,169,2,146,169,32,18,32
  287. 2870 data146,32,18,169,2,127
  288. 2880 : 5. zeile
  289. 2890 data26,32,146,4,18,32,146,2,18,32
  290. 2900 data146,3,110,4,110,2,18,32,146
  291. 2910 data32,18,32,146,164,164,18,32
  292. 2920 : 6. zeile
  293. 2930 data21,32,146,4,18,32,146,2,18,32
  294. 2940 data146,2,110,4,110,3,18,32,146
  295. 2950 data32,18,32
  296. 2960 : 7. zeile
  297. 2970 data29,32,146,4,127,18,2,146,169
  298. 2980 data32,18,169,3,146,32,18,169,2
  299. 2990 data146,169,32,18,32,146,32,127
  300. 3000 data18,2,146,169
  301. 3010 rem *******************
  302. 3020 rem *** datas teile ***
  303. 3030 rem *******************
  304. 3040 a=peek(61)+256*peek(62)
  305. 3050 poke65,aand255
  306. 3060 poke66,a/256
  307. 3070 fori=0to11:forj=0to2
  308. 3080 t(i,j)=j+11:next
  309. 3090 forj=3to4
  310. 3100 reada:t(i,j)=a
  311. 3110 nextj,i
  312. 3120 t(11,2)=17
  313. 3130 fori=0to2:forj=0to4
  314. 3140 t(i+12,j)=t(i,j)
  315. 3150 t(i+15,j)=t(i,j)
  316. 3160 t(i+18,j)=t(i,j)
  317. 3170 nextj,i
  318. 3180 fori=21to23:forj=0to4
  319. 3190 t(i,j)=t(7,j):nextj,i
  320. 3200 forj=0to4
  321. 3210 t(24,j)=t(3,j):t(27,j)=t(3,j)
  322. 3220 t(25,j)=t(4,j):t(28,j)=t(4,j)
  323. 3230 t(26,j)=t(8,j):t(29,j)=t(8,j)
  324. 3240 t(30,j)=t(5,j):t(31,j)=t(9,j)
  325. 3250 t(32,j)=t(10,j):next
  326. 3260 return
  327. 3270 data10,14,14,9,14,8,18,23,18,19
  328. 3280 data8,18,7,17,17,18,16,18,8,16
  329. 3290 data8,17,18,23
  330. 3300 ***********************
  331. 3310 *** lesen highscore ***
  332. 3320 ***********************
  333. 3330 sys50256:open15,8,15
  334. 3340 open3,8,3,"0:h.s. puzzle,u,r"
  335. 3350 input#15,a,a$,a0,a1
  336. 3360 ifa=0thenhs=1:goto3480
  337. 3370 close3:close15
  338. 3380 printchr$(156)chr$(147)
  339. 3390 printa,a$,a0,a1
  340. 3400 print"wenn highscore vorhanden,"
  341. 3410 print"diskette einlegen und"
  342. 3420 print"'j' eingeben."
  343. 3430 print"sonst 'n' eingeben."
  344. 3440 geta$
  345. 3450 ifa$="j"then3330
  346. 3460 ifa$<>"n"then3440
  347. 3470 hs=0
  348. 3480 a$="    "
  349. 3490 a=0
  350. 3500 fori=1to20
  351. 3510 ifhs=0then3530
  352. 3520 input#3,a$,a
  353. 3530 hs$(i)=a$
  354. 3540 hs(i)=a
  355. 3550 next
  356. 3560 close3:close15
  357. 3570 sys49161
  358. 3580 return
  359. 3590 **************************
  360. 3600 *** anzeigen highscore ***
  361. 3610 **************************
  362. 3620 printchr$(30)chr$(147)
  363. 3630 printspc(15)"ehrentafel"
  364. 3640 print:print
  365. 3650 a$=""
  366. 3660 fori=1to7
  367. 3670 a$=a$+chr$(32)
  368. 3680 next
  369. 3690 fori=1to10
  370. 3700 a0$=right$(a$+str$(hs(i)),7)
  371. 3710 a1$=right$(a$+str$(hs(i+10)),7)
  372. 3720 ifhs(i)=0thena0$=a$
  373. 3730 ifhs(i+10)=0thena1$=a$
  374. 3740 printspc(6)hs$(i)spc(1)a0$;
  375. 3750 printspc(1)chr$(122)chr$(122);
  376. 3760 printspc(1)hs$(i+10)spc(1)a1$
  377. 3770 next
  378. 3780 pokeze,22:pokesp,0:syscu
  379. 3790 print"weiter = return"
  380. 3800 poke198,0
  381. 3810 geta$
  382. 3820 ifa$<>chr$(13)then3810
  383. 3830 return
  384. 3840 ************************
  385. 3850 *** update highscore ***
  386. 3860 ************************
  387. 3870 sys50256
  388. 3880 printchr$(30)chr$(147)
  389. 3890 pokeze,10:pokesp,13:syscu
  390. 3900 print"namen eingeben (4 stellen)"
  391. 3910 print:fori=1tos                  
  392. 3920 ifms(i,0)<hs(20)then4140
  393. 3930 a0$=""
  394. 3940 poke198,0
  395. 3950 printspc(13)"spieler"i" = ";
  396. 3960 forj=1to4
  397. 3970 geta$
  398. 3980 ifa$=chr$(13)thenj=4:goto4030
  399. 3990 ifa$<chr$(46)then3970
  400. 4000 ifa$>chr$(90)then3970
  401. 4010 printa$;
  402. 4020 a0$=a0$+a$
  403. 4030 next
  404. 4040 forj=19to1step-1
  405. 4050 hs$(j+1)=hs$(j)
  406. 4060 hs(j+1)=hs(j)
  407. 4070 a=j+1
  408. 4080 ifms(i,0)>hs(j)thena=j
  409. 4090 hs(a)=ms(i,0)
  410. 4100 hs$(a)=left$(a0$+"    ",4)
  411. 4110 ifa<>jthenj=0
  412. 4120 next
  413. 4130 print
  414. 4140 next
  415. 4150 gosub3620
  416. 4160 printchr$(147)
  417. 4170 ifhs=0then4210
  418. 4180 open1,8,15
  419. 4190 print#1,"s:h.s. puzzle"
  420. 4200 close1
  421. 4210 open15,8,15
  422. 4220 open3,8,3,"0:h.s. puzzle,u,w"
  423. 4230 poke198,0
  424. 4240 input#15,a,a$,a0,a1
  425. 4250 ifa=0then4350
  426. 4260 close3:close15
  427. 4270 printchr$(147)a,a$,a0,a1
  428. 4280 print"wenn highscore gewuenscht,"
  429. 4290 print"diskette einlegen und"
  430. 4300 print"'j' eingeben."
  431. 4310 print"sonst 'n' eingeben."
  432. 4320 geta$:ifa$="n"then4400
  433. 4330 ifa$="j"then4180
  434. 4340 goto4320
  435. 4350 fori=1to20
  436. 4360 ifhs(i)=0thenhs$(i)="    "
  437. 4370 print#3,hs$(i);chr$(13);hs(i)
  438. 4380 next
  439. 4390 close3:close15
  440. 4400 sys49161
  441. 4410 return
  442.