home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Disc 33
/
Commodore_Disc_33_19xx_-_de.d64
/
puzzle
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
8KB
|
442 lines
10 rem *************************
20 rem puzzle ***
30 rem ***
40 rem ein programm ***
50 rem fuer den c64 ***
60 rem ***
70 rem (c) by g. kramer ***
80 rem 4407 emsdetten ***
90 rem *************************
100 ifa=1then130
110 a=1
120 load"mp puzzle",8,1
130 gosub300
140 gosub710
150 ifs=0then260
160 gosub1130
170 gosub1580
180 poke198,0
190 geta$:ifa$=""then190
200 gosub3870
210 r=0:fori=1to2
220 bo(i)=0:forj=0to1
230 ms(i,j)=0:nextj,i
240 printchr$(158)chr$(147)
250 gosub920:ifs>0then160
260 sys50256:end
270 rem ********************
280 rem *** anfangswerte ***
290 rem ********************
300 poke247,0:poke248,0
310 poke249,249:poke250,249
320 poke2,0:sys12*4096
330 poke53281,0
340 printchr$(144)chr$(147)
350 b=1024:f=55296
360 ze=214:sp=211:cu=58640
370 dima$(6),t(32,4)
380 dimms(2,1)
390 dimbo(2)
400 dimhs$(20),hs(20)
410 jt=6:poke49257,jt
420 gosub3040
430 gosub3330
440 return
450 rem ************************
460 rem *** ausgeben zeichen ***
470 rem ************************
480 fori=0to4:forj=atoa+160step40
490 pokeb+i+j,32:pokef+i+j,a1
500 nextj,i
510 fori=0to4
520 a0=int(t(a2,i)/5)
530 a3=t(a2,i)-5*a0
540 pokeb+a+a3+40*a0,224
550 next
560 return
570 rem *********************
580 rem *** kessel auf/zu ***
590 rem *********************
600 a1=peek(f+a-1)
610 fori=atoi+11
620 pokef+i,a1:pokeb+i,a0
630 next
640 fori=a+2toi-200step-40
650 pokef+i,a1:pokef+i+6,a1
660 pokeb+i,a0:pokeb+i+6,a0
670 next:return
680 rem *************
690 rem *** titel ***
700 rem *************
710 printchr$(144)chr$(147)
720 pokeze,0:pokesp,0:syscu
730 gosub2620
740 fori=0to6
750 printspc(7)a$(i):next
760 fori=1to500
770 a=40*int(7*rnd(0))
780 a=a+int(26*rnd(0))+7
790 pokef+a,2+int(13*rnd(0)):next
800 fori=0to6:forj=7to32
810 a=f+j+40*i
820 if(peek(a)and15)=0thenpokea,7
830 nextj,i
840 printchr$(30)
850 pokeze,10:pokesp,0:syscu
860 printspc(12)"ein programm von"
870 print:printchr$(153)
880 printspc(16)"g.kramer"
890 fori=567to592
900 pokef+i,4:pokeb+i,111
910 next
920 print:print
930 print"bitte eingeben:"
940 print
950 print"1-2=anzahl spieler"
960 print
970 print" 3=highscore zeigen"
980 print
990 print" 0=ende";
1000 poke198,0:s=0
1010 geta$:ifa$="0"then1090
1020 ifa$="3"thengosub3620:goto1050
1030 ifa$="4"thengosub3870:goto1050
1040 goto1060
1050 printchr$(147):goto840
1060 ifa$<"1"ora$>"2"then1010
1070 s=val(a$)
1080 ss=sor1
1090 return
1100 rem *********************
1110 rem *** bild aufbauen ***
1120 rem *********************
1130 printchr$(31)chr$(147);
1140 ba=1
1150 ifs=1thenba=11
1160 pa=ba+200
1170 a$=chr$(32)+chr$(32)+chr$(146)
1180 a0$=left$(a$,2)
1190 fori=1to6
1200 a$=a$+chr$(32)+chr$(32)
1210 a0$=a0$+chr$(32)+chr$(32)
1220 next
1230 a$=a$+chr$(18)+chr$(32)+chr$(32)
1240 a0$=a0$+right$(a$,2)
1250 fori=5to19
1260 pokeze,i:pokesp,ba:syscu
1270 printchr$(18)chr$(28)a$spc(6);
1280 ifs=2thenprintchr$(31)a$
1290 next
1300 fori=20to21
1310 pokeze,i:pokesp,ba:syscu
1320 printchr$(18)chr$(28)a0$spc(6);
1330 ifs=2thenprintchr$(31)a0$
1340 next
1350 return
1360 rem ***********************
1370 rem *** punkte ausgeben ***
1380 rem ***********************
1390 fori=1tos:forj=0to1
1400 pokeze,22:pokesp,0:syscu
1410 ifms(i,j)=0then1490
1420 a$=chr$(146)+chr$(164)+chr$(164)
1430 a$=a$+a$+a$:a=ba+i*22-22+j*10
1440 ifj=1thena$="bonus"
1450 printchr$(158)spc(a)a$
1460 a$=right$(" "+str$(ms(i,j)),6)
1470 printspc(a)chr$(18)a$
1480 goto1530
1490 a$=chr$(146)+chr$(32)+chr$(32)
1500 a$=a$+a$+a$:a=ba+i*22-22+j*10
1510 printspc(a)a$
1520 printspc(a)a$
1530 nextj,i
1540 return
1550 rem *************
1560 rem *** spiel ***
1570 rem *************
1580 r=r+1:a$=str$(r)
1590 pokeze,8:pokesp,ba+21-len(a$)
1600 syscu
1610 printchr$(146)chr$(156)a$
1620 a=pa+2:a0=102:gosub600
1630 ifs=2thena=pa+24:gosub600
1640 a1=int(11*rnd(0))+3
1650 ifa1=6thena1=7
1660 a2=33:ifr>100thena2=12
1670 a2=int(33*rnd(0))
1680 fork=1tos:a=ba+22*k-17
1690 if(ssandk)>0thengosub480:goto1720
1700 pokesp,a+1:pokeze,2:syscu
1710 printchr$(156)"ende"
1720 next
1730 gosub1390
1740 poke251,ba+5:poke252,4
1750 poke253,ba+5:poke254,200
1760 poke2,ss
1770 poke250,249:poke249,249
1780 poke248,4
1790 ti$="000000":x=50
1800 poke249,x
1810 a$=str$(249-x)
1820 pokeze,10:pokesp,ba+21-len(a$)
1830 syscu
1840 printchr$(146)chr$(28)a$
1850 a=peek(2)
1860 if(aand5)<>4then1880
1870 ms(1,1)=249-x:poke2,peek(2)and10
1880 if(aand10)<>8then1900
1890 ms(2,1)=249-x:poke2,peek(2)and5
1900 gosub1390
1910 geta$:ifa$=chr$(133)then1950
1920 ifa$<>chr$(134)then1970
1930 jt=jt+1:ifjt>50thenjt=50
1940 goto1960
1950 jt=jt-1:ifjt=0thenjt=1
1960 poke49257,jt
1970 ifpeek(2)=0then2000
1980 x=x+1+int(r/50):ifx>249thenx=249
1990 goto1800
2000 poke249,249
2010 if(ssor1)=0then2060
2020 fori=51203+batoi+9step2
2030 a=peek(i)+256*peek(i+1)
2040 ifa<1224thenss=ssand2
2050 next
2060 if(ssor2)=0then2110
2070 fori=51225+batoi+9step2
2080 a=peek(i)+256*peek(i+1)
2090 ifa<1224thenss=ssand1
2100 next
2110 fori=1tos
2120 if(ssandi)>0then2180
2130 pokeze,21:pokesp,0:syscu
2140 a=ba+i*22-17
2150 a$=chr$(32)+"ende"+chr$(32)
2160 printchr$(18)spc(a)a$chr$(146)
2170 ms(i,1)=0
2180 next:gosub1390
2190 ifss=0then2580
2200 a$="0"
2210 fork=1tos
2220 fori=ba+740+k*22toi-520step-40
2230 forj=0to11
2240 a=peek(b+i+j)
2250 ifa<>160thenj=19
2260 next
2270 ifj=20then2390
2280 forl=0to16
2290 forj=0to11
2300 pokef+i+j,l
2310 nextj,l
2320 poke167,(b+i)and255
2330 poke168,(b+i)/256
2340 gosub1390
2350 sys50179
2360 ms(k,1)=ms(k,1)+200
2370 gosub1390
2380 i=i+40:a$="1"
2390 nexti,k
2400 ifa$="1"then2200
2410 fori=1tos
2420 ms(i,0)=ms(i,0)+ms(i,1)
2430 ms(i,1)=0
2440 next:gosub1390
2450 fori=1tos
2460 a=int(ms(i,0)/5000)
2470 ifa=bo(i)then2560
2480 bo(i)=a
2490 fork=0to16
2500 forj=ba+740+i*22toj+11
2510 pokef+j,k
2520 nextj,k
2530 poke167,(b+j-12)and255
2540 poke168,(b+j-12)/256
2550 sys50179
2560 next
2570 goto1580
2580 return
2590 rem *******************
2600 rem *** datas titel ***
2610 rem *******************
2620 a=peek(61)+256*peek(62)
2630 poke65,aand255
2640 poke66,a/256
2650 fori=0to6
2660 ifi<>2then2680
2670 a$(2)=a$(1):goto2770
2680 reada:a$(i)=chr$(18)
2690 forj=1toa
2700 reada:ifa>17then2750
2710 fork=1toa
2720 a$(i)=a$(i)+chr$(32)
2730 next
2740 goto2760
2750 a$(i)=a$(i)+chr$(a)
2760 next
2770 next
2780 return
2790 : 1. zeile
2800 data2,3,127
2810 : 2.+3. zeile
2820 data9,32,146,2,18,32,146,16,18,32
2830 : 4. zeile
2840 data32,3,146,169,32,18,32,146,2
2850 data18,32,146,32,18,169,2,146,169
2860 data32,18,169,2,146,169,32,18,32
2870 data146,32,18,169,2,127
2880 : 5. zeile
2890 data26,32,146,4,18,32,146,2,18,32
2900 data146,3,110,4,110,2,18,32,146
2910 data32,18,32,146,164,164,18,32
2920 : 6. zeile
2930 data21,32,146,4,18,32,146,2,18,32
2940 data146,2,110,4,110,3,18,32,146
2950 data32,18,32
2960 : 7. zeile
2970 data29,32,146,4,127,18,2,146,169
2980 data32,18,169,3,146,32,18,169,2
2990 data146,169,32,18,32,146,32,127
3000 data18,2,146,169
3010 rem *******************
3020 rem *** datas teile ***
3030 rem *******************
3040 a=peek(61)+256*peek(62)
3050 poke65,aand255
3060 poke66,a/256
3070 fori=0to11:forj=0to2
3080 t(i,j)=j+11:next
3090 forj=3to4
3100 reada:t(i,j)=a
3110 nextj,i
3120 t(11,2)=17
3130 fori=0to2:forj=0to4
3140 t(i+12,j)=t(i,j)
3150 t(i+15,j)=t(i,j)
3160 t(i+18,j)=t(i,j)
3170 nextj,i
3180 fori=21to23:forj=0to4
3190 t(i,j)=t(7,j):nextj,i
3200 forj=0to4
3210 t(24,j)=t(3,j):t(27,j)=t(3,j)
3220 t(25,j)=t(4,j):t(28,j)=t(4,j)
3230 t(26,j)=t(8,j):t(29,j)=t(8,j)
3240 t(30,j)=t(5,j):t(31,j)=t(9,j)
3250 t(32,j)=t(10,j):next
3260 return
3270 data10,14,14,9,14,8,18,23,18,19
3280 data8,18,7,17,17,18,16,18,8,16
3290 data8,17,18,23
3300 ***********************
3310 *** lesen highscore ***
3320 ***********************
3330 sys50256:open15,8,15
3340 open3,8,3,"0:h.s. puzzle,u,r"
3350 input#15,a,a$,a0,a1
3360 ifa=0thenhs=1:goto3480
3370 close3:close15
3380 printchr$(156)chr$(147)
3390 printa,a$,a0,a1
3400 print"wenn highscore vorhanden,"
3410 print"diskette einlegen und"
3420 print"'j' eingeben."
3430 print"sonst 'n' eingeben."
3440 geta$
3450 ifa$="j"then3330
3460 ifa$<>"n"then3440
3470 hs=0
3480 a$=" "
3490 a=0
3500 fori=1to20
3510 ifhs=0then3530
3520 input#3,a$,a
3530 hs$(i)=a$
3540 hs(i)=a
3550 next
3560 close3:close15
3570 sys49161
3580 return
3590 **************************
3600 *** anzeigen highscore ***
3610 **************************
3620 printchr$(30)chr$(147)
3630 printspc(15)"ehrentafel"
3640 print:print
3650 a$=""
3660 fori=1to7
3670 a$=a$+chr$(32)
3680 next
3690 fori=1to10
3700 a0$=right$(a$+str$(hs(i)),7)
3710 a1$=right$(a$+str$(hs(i+10)),7)
3720 ifhs(i)=0thena0$=a$
3730 ifhs(i+10)=0thena1$=a$
3740 printspc(6)hs$(i)spc(1)a0$;
3750 printspc(1)chr$(122)chr$(122);
3760 printspc(1)hs$(i+10)spc(1)a1$
3770 next
3780 pokeze,22:pokesp,0:syscu
3790 print"weiter = return"
3800 poke198,0
3810 geta$
3820 ifa$<>chr$(13)then3810
3830 return
3840 ************************
3850 *** update highscore ***
3860 ************************
3870 sys50256
3880 printchr$(30)chr$(147)
3890 pokeze,10:pokesp,13:syscu
3900 print"namen eingeben (4 stellen)"
3910 print:fori=1tos
3920 ifms(i,0)<hs(20)then4140
3930 a0$=""
3940 poke198,0
3950 printspc(13)"spieler"i" = ";
3960 forj=1to4
3970 geta$
3980 ifa$=chr$(13)thenj=4:goto4030
3990 ifa$<chr$(46)then3970
4000 ifa$>chr$(90)then3970
4010 printa$;
4020 a0$=a0$+a$
4030 next
4040 forj=19to1step-1
4050 hs$(j+1)=hs$(j)
4060 hs(j+1)=hs(j)
4070 a=j+1
4080 ifms(i,0)>hs(j)thena=j
4090 hs(a)=ms(i,0)
4100 hs$(a)=left$(a0$+" ",4)
4110 ifa<>jthenj=0
4120 next
4130 print
4140 next
4150 gosub3620
4160 printchr$(147)
4170 ifhs=0then4210
4180 open1,8,15
4190 print#1,"s:h.s. puzzle"
4200 close1
4210 open15,8,15
4220 open3,8,3,"0:h.s. puzzle,u,w"
4230 poke198,0
4240 input#15,a,a$,a0,a1
4250 ifa=0then4350
4260 close3:close15
4270 printchr$(147)a,a$,a0,a1
4280 print"wenn highscore gewuenscht,"
4290 print"diskette einlegen und"
4300 print"'j' eingeben."
4310 print"sonst 'n' eingeben."
4320 geta$:ifa$="n"then4400
4330 ifa$="j"then4180
4340 goto4320
4350 fori=1to20
4360 ifhs(i)=0thenhs$(i)=" "
4370 print#3,hs$(i);chr$(13);hs(i)
4380 next
4390 close3:close15
4400 sys49161
4410 return