home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Big Mouth 9
/
Big_Mouth_The_09_1996_-_Side_C.d64
/
video jigsaw
(
.txt
)
< prev
Wrap
Commodore BASIC
|
2023-02-26
|
6KB
|
191 lines
10 if aa=1then90
20 dimn$(20):poke53280,0:poke53281,0:print"[147][129]"tab(13)" video jigsaw "
30 gosub1230:aa=1:print"[147] loading "n$(a)
40 print" please wait....[144]"
50 ifleft$(n$(a),1)="d"thenzz=1
60 ifleft$(n$(a),1)="[129]"thenzz=2
70 poke49990,zz
80 load n$(a),8,1
90 poke55,0:poke56,92:clr:zz=peek(49990):dim n$(200)
100 fora=828to873:read d:pokea,d:next
110 fora=49879to49973:read d:pokea,d:next
120 print"[147]":poke781,8:poke782,5:poke783,0:sys65520
130 print"choose size of puzzle pieces:"
140 print"(smaller numbers give harder puzzles)"
150 poke781,14:poke782,2:poke783,0:sys65520
160 print"length (from 2 to 12[146])";:input l$
170 l=val(l$):ifl<2orl>12then150
180 poke781,18:poke782,2:poke783,0:sys65520
190 print "width (from 2 to 20[146])";:input w$
200 w=val(w$):ifw<2orw>20then180
210 print"[147] once puzzle appears you may see"
220 print" picture as it should look when"
230 print" finished by pressing f1"
240 print"[158] plug joystick into port 2"
250 print" puzzle construction will blank"
260 print" screen for 1 to 2 minutes"
270 print" press any key to start construction"
280 get k$:ifk$=""then print"[145]";:poke646,peek(56325):goto270
290 poke53265,peek(53265)and239
300 ifzz=1thengosub1530
310 ifzz=2thengosub1570:gosub1530:poke53281,peek(34576)
320 fora=32704to32767:read d:pokea,d:next
330 v=53248:sid=54272:xx =24+(w*4-4):yy=50+(l*4)-4
340 pokesid+5,9:pokesid+6,9
350 max=xx+(int(40/w)-1)*8*w:myx=yy+(int(25/l)-1)*8*l
360 dim s(1000):dimc(1000)
370 def fn hi(m)=int(m/256):def fn lo(m)=m-256*fn hi(m)
380 for n =0 to int (25/l)-1
390 for n1=0 to int (40/w)-1
400 b=b+1
410 s(b)=24576+n1*(w*8)+n*(l*320)
420 c(b)=55296+n1*(w)+n*(40*l)
430 a$=a$+chr$(b)
440 next n1:nextn
450 d$=a$:b$=a$
460 fori=1tob:a=i+int((b+1-i)*rnd(0))
470 d$=mid$(d$,a,1)+left$(d$,a-1)+right$(d$,b-a)
480 next
490 z=int(len(d$)/2)*2-2
500 fori=1to z step2:x1=asc(mid$(d$,i,1)):x2=asc(mid$(d$,i+1,1))
510 gosub1020:gosub760
520 poke53280,i:next:d$=b$:b$=a$
530 b=1
540 pokev+28,peek(v+28)or1:pokev+39,7:pokev+37,2:pokev+38,5:pokev,x
550 pokev+1,y:poke24568,255:pokev+21,1
560 poke53265,peek(53265)and239
570 poke53265,59:poke53272,120:poke56576,peek(56576)and254
580 ifzz=2thenpoke53270,216
590 poke53265,peek(53265)or16
600 pokesid+24,15
610 le=l*8:we=w*8
620 x=xx:y=yy
630 getk$:ifk$="[133]"thengosub1150
640 tg=1-tg:pokev+21,tg:j2=peek(56320)
650 fr=j2and16:jv=15-(j2and15)
660 if fr=0thengosub950:goto630
670 ifjv=1 and y>yy theny=y-le:b=b-int(40/w):goto710
680 ifjv=2 and y<myx theny=y+le:b=b+int(40/w):goto710
690 ifjv=4 and x>xx thenx=x-we:b=b-1:goto710
700 ifjv=8 and x<max thenx=x+we:b=b+1
710 tr=(x>255)
720 pokev+16,tr*(-1)
730 pokev,x+(tr*255):pokev+1,y
740 goto630
750 gosub1020:ifb$=d$then en=1
760 forn=0tol-1:for n1=0tow-1
770 y1=s(x1)+(n1*8)+(n*320):c1=c(x1)+n1+n*40:v1=c1-31744
780 y2=s(x2)+(n1*8)+(n*320):c2=c(x2)+n1+n*40:v2=c2-31744
790 yl=fn lo(y1):yh= fn hi(y1)
800 xl=fn lo(y2):xh= fn hi(y2)
810 poke165,yl:poke166,yh:poke167,xl:poke168,xh
820 sys 828
830 ifzz=2 then poke49160,peek(c1):pokec1,peek(c2):pokec2,peek(49160)
840 poke49161,peek(v1):pokev1,peek(v2):pokev2,peek(49161)
850 next:next
860 ifen=1then1060
870 return
880 poke53270,200:poke53265,27:poke53272,21:poke56576,peek(56576)or1:pokev+21,0
890 poke53280,0:poke53281,0:print"[147][129] load another picture puzzle and"
900 print" play again (y/n)[146] ";
910 geta$:ifa$=""then910
920 ifa$="n"then poke55,0:poke56,160:clr:stop
930 ifa$="y"thenprint:goto30
940 goto910
950 fl=fl+1
960 iffl=2thenx2=b:ifx2=x1then fl=1:return
970 if fl=2 then fl=0:gosub990:gosub750:return
980 x1=b:gosub1000:return
990 hf=110:lf=0:gosub1010:return
1000 hf=70:lf=0:gosub1010:return
1010 pokesid+1,hf:pokesid,lf:pokesid+4,17:pokesid+4,16:return
1020 ifx1>x2thenx3=x1:x1=x2:x2=x3
1030 x1$=mid$(b$,x1,1):x2$=mid$(b$,x2,1)
1040 b$=left$(b$,x1-1)+x2$+mid$(b$,x1+1,x2-x1-1)+x1$+right$(b$,len(b$)-x2)
1050 return
1060 for r=0to2
1070 pokesid+5,85:pokesid+6,85:pokesid+12,85:pokesid+13,85
1080 pokesid+4,33:pokesid+11,17
1090 forn=0to5:forx=0to3:v(x)=peek(850+(n*4)+x):next
1100 pokesid+1,v(0):pokesid,v(1):pokesid+8,v(2):pokesid+7,v(3):poke53280,v(2)
1110 ifh1=50then for t=1to200:next
1120 fort=1to125:next:next
1130 pokesid+4,32:pokesid+11,16:forw=1to500:next:next
1140 goto880
1150 ifzz=2thengosub1620
1160 poke53272,8:poke56576,(peek(56576)and252)or1
1170 pokev+21,0
1180 getk$:ifk$<>"[133]"then1180
1190 ifzz=2thengosub1620
1200 poke53272,120:poke56576,(peek(56576)and252)or2
1210 pokev+21,1
1220 return
1230 print" please insert disk containing doodle[146]":n=1
1240 print tab(8);"or koala[146] picture files"
1250 print" press any key when ready"
1260 getk$:if k$=""then1260
1270 print"[147]"tab(12);" picture files "
1280 open1,8,0,"$"
1290 get#1,b$:ifst<>0then1400
1300 ifn>19then1400
1310 ifb$<>chr$(34)then1290
1320 n$=""
1330 get#1,b$:ifb$<>chr$(34)then n$=n$+b$:goto1330
1340 get#1,b$:ifb$=chr$(32)then1340
1350 ifleft$(n$,1)=" "then n=n-1:goto1380
1360 ifleft$(n$,2)<>"dd"andleft$(n$,1)<>"[129]" thenn=n-1:goto1380
1370 n$(n)=n$:printtab(12)n$(n)
1380 get#1,b$:ifb$<>""then1380
1390 if st=0then n=n+1:goto1290
1400 close1
1410 ifn=1thenprint" no pictures on this disk":fori=1to2000:next:goto1230
1420 print" (use cursor up/down to highlight)
1430 [153]" press return to load picture
1440 a=1:c1=0:c=125:gosub1510
1450 k=peek(197):sh=peek(653):ifk<>7andk<>1then1450
1460 ifk=7andsh=0anda<(n-1)thenc1=1:gosub1500
1470 ifk=7and sh=1anda>1thenc1=-1:gosub1500
1480 ifk=1thenreturn
1490 goto1450
1500 fori=0to24:poke55296+i+(a)*40+c,8:next
1510 a=a+c1:fori=0to24:poke55296+i+(a)*40+c,1:next
1520 return
1530 poke49872,0:poke49873,92:poke49874,0:poke49875,96:poke49876,0
1540 poke49877,128:poke49878,0:sys49879
1550 poke49872,0:poke49873,96:poke49874,0:poke49875,128:poke49876,0
1560 poke49877,160:poke49878,0:sys49879:return
1570 poke49872,64:poke49873,127:poke49874,39:poke49875,131:poke49876,0
1580 poke49877,92:poke49878,0:sys49879
1590 poke49872,40:poke49873,131:poke49874,15:poke49875,135:poke49876,0
1600 poke49877,216:poke49878,0:sys49879
1610 poke49877,196:poke49878,0:sys49879:return
1620 poke49872,0:poke49873,216:poke49874,0:poke49875,220:poke49876,0
1630 poke49877,196:poke49878,1:sys49879:return
1640 data 160,0,177,165,153,0,192,177
1650 data 167,145,165,185,0,192,145,167
1660 data 200,192,8,208,237,96,25,30
1670 data 18,209,33,135,25,30,42,62
1680 data 31,165,50,60,37,162,42,62
1690 data 31,165,50,60,37,162
1700 data 173,210,194,205,208,194,173
1710 data 211,194,237,209,194,144,80,173
1720 data 208,194,133,251,173,209,194
1730 data 133,252,173,212,194,133,253
1740 data 173,213,194,133,254,173,210
1750 data 194,133,247,173,211,194,133
1760 data 248,173,214,194,133,249,160,0
1770 data 177,251,166,249,240,8,133,250
1780 data 177,253,145,251,165,250,145
1790 data 253,230,251,208,2,230,252,230
1800 data 253,208,2,230,254,165,252,197
1810 data 248,208,222,165,247,197,251,48
1820 data 3,76,10,195,96
1830 data 170,192,0,187,0,0,169,0
1840 data 0,183,64,0,193,144,0,0
1850 data 116,0,0,25,0,0,7,64
1860 data 0,1,144,0,0,116,0,0
1870 data 25,0,0,7,0,0,0,0
1880 data 0,0,0,0,0,0,0,0
1890 data 0,0,0,0,0,0,0,0
1900 data 0,0,0,0,0,0,0,197