home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 93
/
093.d81
/
strategy
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
6KB
|
182 lines
1 rem save"strategy v4.2",9
6 deffns(x)=int(x/13):deffnv(x)=x-13*int(x/13):ns=13:nc=52
7 nm$="[144][170][171]strategy[170][171]"
8 jj=-1:dims(nc),x(12),y(12):fori=0tonc-1:s(i)=i:next
9 poke198,0
10 goto500
19 rem choice*
20 gosub62
21 fori=1to10: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=10:y=23: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
80 print"[152]"bt$;:fori=0to22:printbg$;:next:printbb$""
82 poke2023,195:poke56295,12:fori=217to242:pokei,peek(i)or128:next
84 return
90 printtab(10)"[213][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][209][201]"
92 printtab(10)"[215][146][144] s t r a t e g y [214]"
94 printtab(10)"[215][146] [214]"
96 printtab(10)"[215][146] [151]a maurice jones [214]"
97 printtab(10)"[215][146] [151]solitaire [214]"
98 printtab(10)"[202][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][203]"
99 return
110 rem start up
111 dimva$(13),c(12),b(12,52),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]"
115 s$(0)="[162]":s$(1)="[173]":s$(2)="[192]":s$(3)="[193]":co$(0)="[144]":co$(1)="":co$(2)=""
116 co$(3)="[144]":s1$(0)="[161]":s1$(1)="[218]":s1$(2)="[223]":s1$(3)="[176]"
117 fori=0to12:va$(i)=mid$(cr$,i+1,1):vb$(i)=mid$(cs$,i+1,1):next
118 ch$="12345678qh"
119 fori=0to12:readx(i),y(i):next
120 data9,13,17,09,22,09,27,09,32,09,17,16,22,16,27,16,32,16,17,2,22,2,27,2,32,2
122 bk$="!##$[157][157][157][157]@[170][171]%[157][157][157][157]@[170][171]%[157][157][157][157]@[170][171]%[157][157][157][157]\++*[157][157][157][157][145][145][145][145][145]"
123 bl$="[152][191][191][191][191][157][157][157][157][191][191][191][191][157][157][157][157][191][191][191][191][157][157][157][157][191][191][191][191][157][157][157][157][191][191][191][191][157][157][157][157][145][145][145][145][145]"
124 tp$="[213][146][179][179][179][179][179][179][179][179][179][179][179][179][201]":bm$="[202][146][178][178][178][178][178][178][178][178][178][178][178][178][203]"
125 bt$="[192][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][196][193]"
126 bg$="[199][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][191][197]"
127 bb$="[194][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198][198]"
128 cd$="[152][213][209][209][201][157][157][157][157][215][146] [214][157][157][157][157][215][146] [214][157][157][157][157][215][146] [214][157][157][157][157][202][219][219][203]"
129 return
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
134 return
199 rem print card or erase*
200 x=x(i):y=y(i):gosub66
202 ca=b(i,c(i)):su=fns(ca):va=fnv(ca)
204 pokef+24,6:pokef+5,128:pokef+4,129:fort=1to50:next:pokef+4,128:pokef+5,0
206 pokef+24,0:pokef+24,15:pokef+4,129:pokef+4,128
208 ifc(i)<>0then220
214 rem erase card*
216 printbl$;:return
220 printco$(su);va$(va);"[179][179][177][157][157][157][157]";s$(su);"[166][167][174][157][157][157][157][163][170][171][174][157][157][157][157][163][168][169]";s1$(su);
222 print"[157][157][157][157][180][178][178]";vb$(va);"[145][145][145][145][145][157][157][157][157]";:return
249 rem print back****????
250 x=x(i):y=y(i):gosub66
251 ifz8=1then258
252 pokef+24,6:pokef+5,128:pokef+4,129:fort=1to50:next:pokef+4,128:pokef+5,0
254 pokef+24,0:pokef+24,15:pokef+4,129:pokef+4,128:ifz9=1then return
258 printbk$:return
500 gosub111:poke53280,15:poke53281,1:print"[147]"chr$(142)"":poke53272,31
502 gosub80:print"":gosub90
504 gosub131:gosub26
505 fori=1to52:b(0,i)=s(i-1):next:c(0)=52:fori=1to12:c(i)=0:next
506 gosub80
508 x=2:y=2:gosub66:printtp$:y=3:gosub66
509 print"[215][146][144][170][171]strategy[170][171][214]":y=4:gosub66:printbm$"
510 [129]i[178]1[164]12:x[178]x(i):y[178]y(i):[141]66:[153]cd$"";:[139]i[177]8[167]522
514 [153]"waitcmdcmdclr"; [202]([196](i),2,1);:[137]522
518 [153]"waitclrcmdcmdcmdononf"
522 [130]:x[178]4:y[178]13:[141]66:[153]"wait";bk$
523 x[178]4:y[178]21:[141]66:[153]"print#ascascascascascascascascascasc":[153]"valwait stoph - help print#chr$"
524 [153]"str$str$str$str$str$str$str$str$str$str$": wh[178]1
530 [139]c(0)[178]0[167]i[178]0:[141]200:[137]600
532 [139]c(0)[178]1[167]x[178]4:y[178]13:[141]66;:[153] bl$
535 i[178]0:[141]200:fc[178]b(0,c(0))
540 [139][165]v(fc)[178]0[167]555
545 x[178]5:y[178]11:[141]66:[153]"print#sinsinclrtoprint#sinsinsin":[141]20:[139]i[177]8[167]570
548 x[178]x(0):y[178]y(0):[141]66:[153]bl$
550 c(i)[178]c(i)[170]1:b(i,c(i))[178]fc:[141]200:c(0)[178]c(0)[171]1:[137]530
555 x[178]5:y[178]11:[141]66:[153]"any key":[141]62:i[178][165]s(fc)[170]9:c(i)[178]1:b(i,c(i))[178]fc
556 x[178]x(0):y[178]y(0):[141]66:[153]bl$
557 [141]200:c(0)[178]c(0)[171]1:[137]530
570 [145]i[171]8[137]900,1300
599 [143] play to f*
600 wh[178]2
604 [129]j[178]1[164]8:[139]c(j)[178]0[167]612
608 k[178]c(j):pp[178][165]s(b(j,k))[170]9:[139][165]v(b(pp,c(pp)))[170]1[178][165]v(b(j,k))[167]640
612 [130]
616 x[178]4:y[178]8:[141]66:[153]" "
620 x[178]4:y[178]9:[141]66:[153]" no plays "
622 x[178]4:y[178]10:[141]66:[153]" possible "
624 x[178]4:y[178]11:[141]66:[153]" "
628 [158]886:[141]58:[158]907:[137]900
640 x[178]5:y[178]11:[141]66:[153]"print#sinclrfromprint#sinsin":[141]20:[139]i[177]8[167]700
644 fc[178]b(i,c(i)):pi[178][165]s(fc)[170]9:[139][165]v(fc)[171]1[179][177][165]v(b(pi,c(pi)))[167]640
648 c(i)[178]c(i)[171]1:[141]200:c(pi)[178]c(pi)[170]1:b(pi,c(pi))[178]fc:i[178]pi:[141]200
652 tc[178]0:[129]j[178]1[164]8:tc[178]tc[170]c(j):[130]:[139]tc[177]0[167]604
660 [137]800
700 [145]i[171]8[137]900,1300
710 [158]886
711 [153]"print#"bt$;
712 [153]"load"bt$;:[129]i[178]0[164]22:[153]bg$;:[130]
713 [151]214,23:[153]:[153]bb$"":[151]2023,195:[151]56295,12
714 [129]i[178]217[164]242:[151]i,[194](i)[176]128:[130]
715 [129]i[178]1[164]8:[139]c(i)[177]30[167]720
716 [130]:[137]740
720 [153]"stopno more than 30 cards in a pile."
724 [153]"a beta tester might put more than 30
728 print"cards in a pile, but why would
732 [153]"anyone else?
734 print:print:print"--mauricejones"
736 goto764
740 print"[156]";:fori=1to8:print"";mid$(str$(i),2,1):next
742 print"[144]":forj=1to8:x=4:y=2*j-1:gosub66:ifc(j)=0then760
744 fork=1toc(j):print"";:i=j:c(i)=k:gosub202:next
760 next
764 gosub58:sys907:goto1022
800 x=3:y=6:gosub66:print" "
804 printtab(3)" you "
808 printtab(3)" win! "
812 printtab(3)" "
816 goto1002
900 x=3:y=13:gosub66:print" "
902 y=y+1:gosub66:print" "
904 y=y+1:gosub66:print" "
905 tc=0:fori=0to8:tc=tc+c(i):next
906 x=x+2:y=y-1:gosub66:print""tc"cards left"
1002 x=4:y=18:gosub66:print"[156] "
1006 y=y+1:gosub66:print" 1.new game "
1008 y=y+1:gosub66:print" 2.inspect cards "
1010 y=y+1:gosub66:print" 3.to loadstar "
1012 y=y+1:gosub66:print" "
1022 gosub62:if a$<"1"ora$>"3"then1022
1024 onval(a$)goto505,710,6000
1299 rem help
1300 sys886:z7=0:print"[147]/":poke53280,3:poke53281,3
1304 printtab(14)"[144][170][171]strategy[170][171]
1308 [153]" all ofclosethe cards are turned one at
1312 print"a time. aces are played to