home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 99
/
099.d81
/
fourteens
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
6KB
|
180 lines
1 poke56,56:poke55,0:clr
2 dv=peek(186):ifdv<8thendv=8
3 poke53281,0:poke53280,0:print"[147]":gosub60000
4 sys57812"fourteens font",dv,0:poke780,0:poke781,0:poke782,56:sys65493
5 sys57812"ftoolkit cc00",dv,0:poke780,0:poke781,0:poke782,204:sys65493
9 print"[147]"chr$(142)"":poke53272,31:poke198,0:mt=52224
10 goto500
19 rem choice*
20 gosub62
21 fori=1tocc:ifa$=mid$(ch$,i,1)thenreturn
22 next:goto20
25 rem charge*
26 a$="251331421502421502"
27 t=87:pokef+6,96:pokef+24,15
28 fori=1to18step3
29 pokef+1,val(mid$(a$,i,2)):pokef+4,33
30 forj=1tot*val(mid$(a$,i+2,1)):next
31 pokef+4,0:next:return
57 rem any key-get a$*
58 x=9:y=24:gosub66:print" please press a key [145][145][145]"
62 geta$:ifa$=""then70:return
64 rem print at*
66 poke211,x:poke214,y:sys58732:return
69 rem multitask *
70 ifjj=nc-2thenjj=-1
71 jj=jj+1:j%=jj+int(rnd(0)*(nc-jj)):temp=s(jj):s(jj)=s(j%):s(j%)=temp:goto62
110 rem start up
111 dimva$(13),vb$(13):f=54272:fori=ftof+78:pokei,0:next
112 cr$="[216][203][202][201][200][199][198][197][196]&[195][194][217]":cs$="[204][215][214][213][212][211][210][209][208]'[207][206][205]"
113 s$(0)="[162]":s$(1)="[173]":s$(2)="[192]":s$(3)="[193]":co$(0)="[144]":co$(1)="":co$(2)=""
114 co$(3)="[144]":s1$(0)="[161]":s1$(1)="[218]":s1$(2)="[223]":s1$(3)="[176]"
115 fori=0to12:va$(i)=mid$(cr$,i+1,1):vb$(i)=mid$(cs$,i+1,1):next
116 bk$="!##$[157][157][157][157]#[190][190]#[157][157][157][157]#[190][190]#[157][157][157][157]#[190][190]#[157][157][157][157]\++*[157][157][157][157][145][145][145][145]"
117 bl$="[153]@@@@[157][157][157][157]@@@@[157][157][157][157]@@@@[157][157][157][157]@@@@[157][157][157][157]@@@@"
118 bg$="[155] @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
119 b1$="[155]!##$[157][157][157][157]#[190][190]#[157][157][157][157]#[190][190]#[157][157][157][157]#[190][190]#[157][157][157][157]\++*[157][157][157][157][145][145][145][145]"
122 deffns(x)=int(x/13):deffnv(x)=x-13*int(x/13)
126 nc=52:ns=13: jj=-1:dims(nc):fori=0tonc-1:s(i)=i:next
130 rem shuffle
131 ifjj=nc-2thenreturn
132 jj=jj+1:j%=jj+int(rnd(0)*(nc-jj)):temp=s(jj):s(jj)=s(j%):s(j%)=temp
133 ifjj<>nc-2then131
135 dimx(13),y(13),c(13),b(13,5),dk(52),ws(52),ag(52)
140 ch$="123456789abcoqh":cc=len(ch$):dk=0:ws=13
144 x(0)=03:y(0)=16:x(13)=2:y(13)=17
146 k$="123456789abc"
148 return
149 rem end game
150 x=6:y=12:gosub66:print"[213][192][192][192][192][192][192][192][201]"
152 print"[221] you [221]
154 [153]"(NULL) win! (NULL)
156 print"[202][192][192][192][192][192][192][192][203]"
158 goto170
160 z3=0:x=02:y=12:gosub66:print" "
162 print" "
164 print" "
165 zx=0:fori=1to12:zx=zx+c(i):next:zx=zx+c(dk)
166 print"[145][145]";zx;"cards left"
170 x=2:y=17:gosub66:print"[213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]
172 [153]"(NULL) 1. new puzzle (NULL)"
173 [153]"(NULL) 2. same puzzle (NULL)"
174 [153]"(NULL) 3. to loadstar (NULL)
176 print"[202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203]
178 [141]62:[139](a$)[179]"1"[176](a$)[177]"3"[167]178
180 [145][197](a$)[137]512,400,6000
199 [143] print card or erase*
200 x[178]x(i):y[178]y(i):[141]66
202 ca[178]b(i,c(i))
203 su[178][165]s(ca):va[178][165]v(ca):[139]q4[167]208
204 [151]f[170]24,6:[151]f[170]5,128:[151]f[170]4,129:[129]t[178]1[164]10:[130]:[151]f[170]4,128:[151]f[170]5,0
206 [151]f[170]24,0:[151]f[170]24,15:[151]f[170]4,129:[151]f[170]4,128
208 [139]c(i)[179][177]0[167]220
214 [143] erase card*
216 [153]bl$;:[142]
220 [153]co$(su);va$(va);"<<>cmdcmdcmdcmd";s$(su);"spc(then^cmdcmdcmdcmdtab(+-^cmdcmdcmdcmdtab(notstep";s1$(su);
222 [153]"cmdcmdcmdcmdsgn==";vb$(va);"ononononcmdcmdcmdcmd";:[142]
299 [143] deal
300 [129]i[178]1[164]12:[139]c(dk)[178]0[167][142]
302 [143] x=x(dk):y=y(dk):gosub66:printb1$;:printbk$
304 c(i)[178]c(i)[170]1:b(i,c(i))[178]dk(c(dk)):c(dk)[178]c(dk)[171]1
305 [139]k[178]1[167]307
306 y(i)[178]y(i)[170]1
307 [141]200
308 [130]
309 [142]
319 [143] play one to waste
320 [139]c(i)[179]2[167]336
322 c(ws)[178]c(ws)[170]1:ws(c(ws))[178]b(i,c(i))
324 x[178]x(i):y[178]y(i):[141]66:[153]bl$:y(i)[178]y(i)[171]1:c(i)[178]c(i)[171]1:[141]200
328 c(i)[178]c(i)[170]1:x[178]x(ws):y[178]y(ws):[141]66: :[141]202:c(i)[178]c(i)[171]1
332 [142]
336 c(ws)[178]c(ws)[170]1:ws(c(ws))[178]b(i,c(i)):c(i)[178]c(i)[171]1:[141]200:c(i)[178]c(i)[170]1
340 x[178]x(ws):y[178]y(ws):[141]66:[141]202:c(i)[178]c(i)[171]1:[142]
400 [129]i[178]1[164]52:dk(i)[178]ag(i):[130]:[137]514
500 [151]53280,9:[151]53281,9:[153]"load"
501 [158]mt[170]3,0,39,0,24,126,15:[158]mt[170]3,6,34,9,15,255,12:[158]mt[170]3,5,33,8,14,160,15
503 [158]mt[170]18,9,"listf o u r t e e n s":[158]mt[170]18,11,"listplaying card puzzles"
504 [158]mt[170]18,13,"listby maurice jones"
505 [153]"wait"
510 [141]111:[141]26
512 [129]i[178]1[164]52:dk(i)[178]s(i[171]1):ag(i)[178]s(i[171]1):[130]
514 c(dk)[178]52:[129]i[178]1[164]12:c(i)[178]0:[130]:c(ws)[178]0
515 k[178]5:[129]i[178]1[164]6:y(i)[178]5:x(i)[178]k:k[178]k[170]5:[130]
516 k[178]9:[129]i[178]7[164]12:y(i)[178]15:x(i)[178]k:k[178]k[170]5:[130]
517 [151]53280,15:[151]53281,1:[153]"load ";
519 [158]mt[170]3,0,39,0,24,000,13:[158]mt[170]3,0,39,0,2,160,12
521 x[178]11:y[178]1:[141]66:[153]"print#f o u r t e e n s"
522 x[178]0:y[178]24:[141]66
523 [153]"print#/ o - oops h - help q - quit ";
525 [153]"wait";:x[178]x(dk):y[178]y(dk):[141]66:[153]bk$:[129]i[178]1[164]12:x[178]x(i):y[178]y(i):[141]66
529 [153]"clron";[202](k$,i,1):[130]
532 q4[178]1:[129]k[178]1[164]5:[141]300:[130]:q4[178]0:x[178]x(dk):y[178]y(dk):[141]66:[153]bl$
534 x[178]x(13):y[178]y(13)[171]2:[141]66:[153]"clrfrom"
536 [141]20
538 [139]i[179]13[167] 550
542 [145]i[171]12[137]590,160,800
550 [139]c(i)[178]0[167]534
554 op[178]0
562 fc[178]i
564 x[178]x(13):y[178]y(13)[171]2:[141]66:[153]"print@@@@"
566 x[178]x(13):y[178]y(13)[171]2:[141]66:[153]"clrand":[141]20
568 [139]i[179]13[167] 570
569 [145]i[171]12[137]534,160,800
570 [139]c(i)[178]0[167]534
572 [139]fc[178]i[167]534
574 [139][165]v(b(fc,c(fc)))[170][165]v(b(i,c(i)))[179][177]12[167]op[178]1:[137]534
578 sc[178]i:i[178]fc:[141]320:i[178]sc:[141]320
582 [129]i[178]1[164]12:[139]c(i)[179][177]0[167]534
586 [130]:[137]150
590 [139]op[178]1[167]534
594 [139]c(ws)[178]0[167]534
600 x[178]x(ws):y[178]y(ws):[141]66:c(ws)[178]c(ws)[171]1:ca[178]ws(c(ws)):[141]203
604 [129]k[178]1[164]100:[130]
610 [139]c(sc)[179][177]0[167]630
620 c(sc)[178]1:i[178]sc:[141]200:[137]640
630 c(sc)[178]c(sc)[170]1:y(sc)[178]y(sc)[170]1:i[178]sc:[141]200
640 x[178]x(ws):y[178]y(ws):[141]66:c(ws)[178]c(ws)[171]1:ca[178]ws(c(ws)):[139]c(ws)[179][177]0[167]648
644 [153]bl$:[137]650
648 [141]203
649 [129]k[178]1[164]100:[130]
650 [139]c(fc)[179][177]0[167]670
660 c(fc)[178]c(fc)[170]1:i[178]fc:[141]200:op[178]1: [137]534
670 c(fc)[178]c(fc)[170]1:y(fc)[178]y(fc)[170]1:i[178]fc:[141]200:op[178]1:[137]534
799 [143] help
800 [158]mt[170]6,208:[151]53280,9:[151]53281,9:[153]"load"
805 [153]" the fourteen puzzles
810 print:print" [158]the puzzle is solved if all the
820 [153]"cards in piles [1-c] can be removed in
830 print"pairs totaling fourteen. only the top
840 [153]"card of each pile is available. kings
850 print"count 13, queens 12, and jacks 11.
860 [153]:[153]" at the "[199](34)"from"[199](34)" prompt enter the number
870 print"of the pile containing one of the pair
880 [153]"and you will be prompted with "[199](34)"and"[199](34)" for
890 print"the second card.
900 [153]:[153]" at any prompt:
910 print:print" o[158] - oops. takes back last play.
920 [153]:[153]" qsys - quit. ends the solution.
930 print:print" h[158] - help. gives this screen
940 [141]58:[158]mt[170]9,208:[137]534
5999 [143] reconnect*
6000 [151]v[170]21,0:[151]56,160:[156]
6020 [159]15,8,15,"r0:hello connect=hello connect":[132]15,er%:[160]15
6025 [139]er%[179][177]63[167][128]
6030 [151]646,[194](53281):[153]"loadload"[199](34)"hello connect"[199](34)",8"
6035 [153]"run"
6040 [151]631,13:[151]632,13:[151]198,2:[128]
10000 [159]15,8,15,"s0:fourteens":[160]15:[148]"fourteens",8:[128]
60000 [153]"load"