home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 87
/
087.d81
/
supreme
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
15KB
|
451 lines
5 poke56576,4:poke53272,2:poke648,192:poke53265,27
10 poke53280,0:poke53281,0:print"[147][146][156]"tab(10)"solitaires supreme"
20 printtab(10)"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]":poke53269,0:poke50168,45:poke53287,14
30 dimcd(13,25),ac(4,2),dk(52),rk$(13),ln(13),a(4),bk(4),pl(52),un(52)
40 deffnrk(x)=(13*int((x-1)/13)-x)*(x>0)
50 deffnsu(x)=int((x-1)/13)+1
60 deffncd(x)=cd(x,ln(x))
70 forx=1to52:dk(x)=x:next
80 forx=0to4:readcl$(x),su$(x),dn$(x):next
90 data"[144]","","[144]","[144]","[193]","[152]","","[211]","[150]","","[218]","[150]","[144]","[216]","[152]"
100 forx=0to13:readrk$(x):next
110 data"","[209]","[215]","[197]","[210]","[212]","[217]","[213]","[201]","[196]","[198]","[199]","[200]","[202]"
120 bk$="[207][208][157][157][204][186][145]"
130 printtab(13)"[159]1[154] bisley":printtab(13)"[159]2[154] klondike"
140 printtab(13)"[159]3[154] golf":printtab(13)"[159]4[154] gaps"
150 printtab(13)"[159]i[154] instructions"
160 printtab(13)"[159]q[154] quit"
180 geta$:if(a$<"1"ora$>"4")anda$<>"i"anda$<>"q"then180
190 ifa$<>"q"then240
200 poke214,18:print:printtab(20)"[156]are you sure? (y[156]/n[156])"
210 geta$:ifa$<>"y"anda$<>"n"then210
220 ifa$="n"thenpoke214,18:print:printtab(20)" ":goto180
230 print"[147]":poke648,4:poke53272,21:poke56576,(peek(56576)and252)or3:print"[147]"
231 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
232 ifer<>63thenend
233 print"[147][144]load"chr$(34)"hello connect"chr$(34)",8"
234 print"run"
235 poke631,13:poke632,13:poke198,2:end
240 onval(a$)gosub320,1150,2600,3140
250 ifa$<>"i"thenrun
260 poke214,16:print:printtab(15)"[156]for which game? ([159]1[156]-[159]4[156])"
270 geta$:if(a$<"1"ora$>"4")anda$<>"q"then270
280 ifa$="q"thenrun
290 onval(a$)gosub1010,2450,3000,3910
300 run
310 rem bisley
320 gosub4240:gm=1:print""tab(14)"[144]b i s l e y"
330 deffnsy(y)=108+8*y
340 deffnxx(x)=-(x>9)
350 deffnsx(x)=16+24*x-256*fnxx(x)
360 hz=1:ac=0:t=0:gosub4030
370 forx=1to4:a(x)=1:kg(x)=14:ln(x)=3:next:forx=5to13:ln(x)=4:next
380 print"[144][209][193][209][211][209][218][144][209][216]":print" "
381 print"[145][145]"tab(28)" ":printtab(28)" "
390 cd=0:forx=1to13:fory=1to3:cd=cd+1
400 if(fnrk(dk(cd))=1)thencd=cd+1:goto400
410 cd(x,y)=dk(cd):next:next:y=4
420 forx=5to13:cd=cd+1
430 if(fnrk(dk(cd))=1)thencd=cd+1:goto430
440 cd(x,y)=dk(cd):next
450 fory=1to4:forx=1to13:print"";
460 m=cd(x,y):gosub4060
470 next:print:next
480 print"[144]from?":ifhz=0thenhz=1
490 ifln(hz)=0thenhz=hz+1:goto490
500 poke53269,0:poke53264,fnxx(hz):poke53248,fnsx(hz):poke53249,fnsy(ln(hz))
510 poke53269,1:gosub4160
520 ifa$=chr$(13)then630
530 ifa$<>"[157]"anda$<>"[145]"then550
540 hz=hz-1-13*(hz=1):ifln(hz)=0then540
550 ifa$<>""anda$<>""then570
560 hz=hz+1+13*(hz=13):ifln(hz)=0then560
570 ifa$="q"then590
580 goto500
590 print"[144]quit? (y/n)"
600 geta$:ifa$<>"y"anda$<>"n"then600
610 ifa$="n"thenprint"[144] ":goto480
620 poke214,17:print:goto970
630 fm=hz:print"[157][157]";:forx=1tofm:print"";:next:forx=1toln(fm)
640 print"";:next:m=cd(fm,ln(fm)):gosub4090
650 print"[144] to? "
660 poke53269,0:poke53264,fnxx(hz):poke53248,fnsx(hz):poke53249,fnsy(ln(hz))
670 poke53269,1:gosub4160
680 ifa$=chr$(13)then760
690 ifa$="[157]"thenhz=hz-1-14*(hz=0):ifln(hz)=0andhz>0then690
700 ifa$=""thenhz=hz+1+14*(hz=13):ifln(hz)=0andhz>0then700
710 if(a$="[145]"ora$="")thenhz=1+(hz>0)
720 ifhz<>0then750
721 if(fnrk(fncd(fm))=13)then729
722 ifa(fnsu(fncd(fm)))+1=fnrk(fncd(fm))then730
723 ifkg(fnsu(fncd(fm)))-1=fnrk(fncd(fm))then729
724 goto730
729 poke53269,0:poke53248,24*(fnsu(fncd(fm))-1):poke53249,92:poke53264,1:goto670
730 poke53269,0:poke53248,16+24*fnsu(fncd(fm)):poke53249,92:poke53264,0:goto670
740 poke53269,1:goto670
750 goto660
760 tu=hz
770 iftu>0then860
780 if(fnrk(fncd(fm))=13)then820
781 ifa(fnsu(fncd(fm)))+1<>fnrk(fncd(fm))then820
790 print"[157][157]";:forx=1tofnsu(fncd(fm)):print"";:next
800 m=cd(fm,ln(fm)):gosub4060
810 ac=ac+1:a(fnsu(fncd(fm)))=a(fnsu(fncd(fm)))+1:goto910
820 ifkg(fnsu(fncd(fm)))-1<>fnrk(fncd(fm))thengosub980:goto480
830 print"[157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]";:forx=1tofnsu(fncd(fm)):print"";:next
840 m=fncd(fm):gosub4060
850 ac=ac+1:kg(fnsu(fncd(fm)))=kg(fnsu(fncd(fm)))-1:goto910
860 iffnsu(fncd(fm))<>fnsu(fncd(tu))thengosub980:goto480
870 ifabs(fnrk(fncd(fm))-fnrk(fncd(tu)))<>1thengosub980:goto480
880 print"[157][157]";:forx=1totu:print"";:next:forx=1toln(tu)+1
890 print"";:next
900 m=fncd(fm):gosub4060
910 print"[157][157]";:forx=1tofm:print"";:next:forx=1toln(fm)
920 print"";:next
930 ln(tu)=ln(tu)+1:cd(tu,ln(tu))=fncd(fm):ln(fm)=ln(fm)-1
940 m=fncd(fm):gosub4060:print"[157][157][144] "
950 t=t+1:print"[157][157][157][157][144]"t:ln(0)=1:ifac<48then480
960 poke214,17:print:print"[144] congratulations! you won in"t"moves"
970 print"[145][145]":gosub4130:run
980 print"[157][157]";:forx=1tofm:print"";:next:forx=1toln(fm)
990 print"";:next:gosub4060:return
1000 rem bisley instructions
1010 print"[147][156]bisley instructions"
1020 print"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
1030 print"[154] the object is to build all of the"
1040 print" cards in the layout to the aces and"
1050 print" kings in suit."
1060 print" only the bottom card of each row"
1070 print" may be moved. it may be placed on the"
1080 print" ace pile, the king pile, or onto the"
1090 print" bottom of another column, building"
1100 print" either up or down in suit. any time"
1110 print" a king is available, it may be placed"
1120 print" in a row above the layout."
1130 gosub4120:return
1140 rem klondike
1150 gosub4240:gm=2:print""tab(12)"[144]k l o n d i k e"
1160 deffnsy(y)=92+8*y
1170 deffnxx(x)=-(x>6)
1180 deffnsx(x)=56+32*x-256*fnxx(x)
1190 hz=1:ac=0:cs=24:bt(8)=1:gosub4030
1200 forx=1to4:a(x)=0:next:forx=1to7:tp(x)=x:bt(x)=x:next
1210 cd=0:forx=1to7:fory=1tox:cd=cd+1:cd(x,y)=dk(cd):next:next
1220 forx=1to24:cd=cd+1:cd(0,x)=dk(cd):next
1230 print"";
1240 fory=1to7:print"";:forx=1to7:ify<tp(x)thenprintbk$;:goto1260
1250 m=cd(x,y):gosub4060
1260 print"";:next:print:next
1270 print""bk$"";:m=cd(0,1):gosub4060
1280 pl=1:tp(0)=1:bt(0)=1
1290 print"[144]from?":ifhz=8thenhz=1
1291 ifhz<1thenhz=0
1300 if(cs=0or(cs=1andcd(0,bt(0))<>0))andhz=-1thenhz=0
1310 ifhz<1then1460
1320 ifbt(hz)=0thenhz=hz+1+9*(hz>6):goto1300
1330 ifhz<1then1460
1340 poke53269,0:poke53264,fnxx(hz):poke53248,fnsx(hz):poke53249,fnsy(bt(hz))
1350 poke53269,1:gosub4160
1360 ifa$=chr$(13)then1670
1370 ifa$<>"[145]"anda$<>""then1400
1380 ifcd(0,bt(0))<>0and(hz<>0orcs=1)thenhz=0:goto1460
1390 if(cs>1or(cs=1andcd(0,bt(0))=0))thenhz=-1:goto1460
1400 ifa$<>"[157]"then1480
1410 hz=hz-1:ifhz<>0andhz<>-1then1470
1420 ifhz=0andcd(0,bt(0))=0thenhz=-1
1430 ifhz=-1and(cs=0or(cs=1andcd(0,bt(0))<>0))thenhz=8:goto1410
1440 ifhz<1then1460
1450 ifbt(hz)=0then1410
1460 poke53269,0:poke53264,0:poke53248,80+24*hz:poke53249,212:goto1350
1470 hz=hz-9*(hz=-2):ifbt(hz)=0then1410
1480 ifa$<>""then1550
1490 ifhz=7thenhz=-2
1500 hz=hz+1:ifhz>0then1540
1510 ifhz=-1and(cs=0or(cs=1andcd(0,bt(0))<>0))thenhz=0
1520 ifhz=0andcd(0,bt(0))=0thenhz=1:goto1300
1530 goto1460
1540 ifbt(hz)=0then1490
1550 ifa$="q"then1570
1560 goto1340
1570 print"[144]quit? (y/n)"
1580 geta$:ifa$<>"y"anda$<>"n"then1580
1590 print"[144] ":ifa$="n"then1290
1600 print"";
1610 fory=1to7:print"";:forx=1to7
1620 m=cd(x,y):ify<tp(x)then1640
1630 gosub4050:goto1650
1640 gosub4080
1650 print"";:next:print:next
1660 poke214,21:print:goto2430
1670 ifhz<>-1then1740
1680 pl=pl+1:ifpl>23thencs=1:print"[144] [157][157] "
1690 ifcd(0,pl)=0andcs>0andpl<24then1680
1700 bt(0)=pl:tp(0)=pl
1710 poke214,18:print:print"";:m=cd(0,pl):gosub4060
1720 ifcs=1thenprint"[145][144] [157][157] "
1730 goto1290
1740 fm=hz:iffm<>0then1760
1750 poke214,18:print:print"";: