home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 94
/
094.d81
/
thirteens
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
5KB
|
137 lines
9 printchr$(142):poke53272,31:poke198,0:mt=52480
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=10: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
80 ifc(dk)=0then82
81 x=x(dk):y=y(dk):gosub66:printb1$;:fork=1to80:next:printbk$
82 c(i)=0:gosub200:c(i)=1:x=x(ws):y=y(ws):gosub66:gosub202:c(i)=0:return
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$="[129]!##$[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$="[155][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]"
119 deffns(x)=int(x/13):deffnv(x)=x-13*int(x/13)
120 nc=52:ns=13: jj=-1:dims(nc):fori=0tonc-1:s(i)=i:next
121 b1$="[150]!##$[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]"
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(15),y(15),c(15),b(13,1),dk(52),ws(52)
140 ch$="0123456789 qh":cc=13:dk=10:ws=11:np=9
142 x=7: fori=0to4:y(i)=6:y(i+5)=14:x(i)=x+5:x(i+5)=x+5:x=x+5:next
144 x(10)=4:y(10)=07:x(11)=04:y(11)=17
148 return
149 rem end game
150 x=6:y=12:gosub66:print" [192][192][192][192][192][192][192] "
152 y=y+1:gosub66:print" you "
154 y=y+1:gosub66:print" win! "
156 y=y+1:gosub66:print" [192][192][192][192][192][192][192] "
158 wn=0:goto170
160 x=02:y=12:gosub66:print" "
162 y=y+1:gosub66:print" "
164 y=y+1:gosub66:print" "
166 x=x+1:y=y-1:gosub66:print""c(dk)"cards left"
170 x=2:y=17:gosub66: print" [192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192] "
172 y=y+1:gosub66:print" 1. new game "
174 y=y+1:gosub66: print" 2. to loadstar "
176 y=y+1:gosub66:print" [192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192] "
177 sysmt+3,1,39,24,24,160,6
178 gosub62:ifa$<"1"ora$>"2"then178
182 onval(a$)goto512,6000
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=1to20: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][157][157][157][157]";:return
299 rem deal
300 fori=0tonp:ifc(i)>0then308
304 x=x(dk):y=y(dk):gosub66:printb1$;:printbk$:c(i)=1:b(i,1)=dk(c(dk))
306 c(dk)=c(dk)-1:gosub200:ifc(dk)=0then310
308 next
309 return
310 x=x(dk):y=y(dk):gosub66:printbl$:goto309
500 poke53280,8:poke53281,1:sysmt+3,0,39,0,24,126,08:sysmt+3,8,32,10,15,255,0
502 sysmt+3,7,31,9,14,160,06
504 sysmt+18,10,"[212][160][200][160][201][160][210][160][212][160][197][160][197][160][206][160][211]":sysmt+18,12,"a maurice jones "
506 sysmt+18,13,"solitaire "
510 gosub111:gosub26
512 fori=1to52:dk(i)=s(i-1):next:c(dk)=52:fori=0to 9:c(i)=0:next:c(ws)=0
514 poke53280,8:poke53281,1:sysmt+3,0,39,0,24,160,6:sysmt+3,0,39,3,23,127,15
517 x=12:y=1:gosub66:print"[212][160][200][160][201][160][210][160][212][160][197][160][197][160][206][160][211][146]"
521 x=5:y=24:gosub66:print" h - help q - quit[146]";
523 x=0:y=24:gosub66:print"[144]/";
525 x=x(dk):y=y(dk):gosub66:printbk$:fori=0to9:x=x(i):y=y(i):gosub66:
529 print"[156]";mid$(str$(i),2,1):next
530 gosub300
534 sysmt+3,3,8,13,15,160,6:x=4:y=14:gosub66:print"from"
538 gosub20:i=i-1: ifi<10then546
542 oni-9goto578,160,800
546 ifc(i)=0then538
550 iffnv(b(i,c(i)))<>12then558
554 gosub82:goto534
558 x=4:y=14:gosub66:print" "
560 fc=i:x=4:y=14:gosub66:print"and "
562 gosub20:i=i-1:ifi<10then570
566 oni-9goto534,160,800
570 iffnv(b(fc,c(fc)))+fnv(b(i,c(i)))<>11thengosub940:goto534
574 sc=i:i=fc:gosub82:forj=1to100:next: i=sc:gosub82:fori=0to9:ifc(i)>0then534
576 next:ifc(dk)>0then534
577 goto150
578 ifc(dk)=0then534
580 gosub300:goto534
800 poke53280,1:sysmt+6,208:print"[147]" :print"/ thirteens"
802 print: print " discard pairs which total thirteen."
803 print"queens count 12, jacks, 11. discard"
804 print"kings separately. spaces are filled "
806 print"from the deck. the game is won if all
808 [153]"cards can be discarded.
812 print:print" at the "chr$(34)"from"chr$(34)" prompt, enter the num-
820 [153]"ber [0-9] of the pile containing a card
830 print"which you want to discard. if the card
840 [153]"is a king, it will be discarded with no
850 print"further action on your part. otherwise
860 [153]"you will be prompted for number of
870 print"the pile containing the second card.
874 [153]"the space bar will fill empty spaces
876 print"from the deck.
880 [153]:[153]" at any prompt, q ends the game and
890 print"h gives this screen.
900 [141]58:[158]mt[170]9,208:[151]53280,8:[137]534
940 f[178]54272:[151]f[170]24,15:[151]f[170]8,4
950 [151]f[170]12,63:[151]f[170]13,17:[151]f[170]11,33:[129]t[178]1[164]100:[130]:[151]f[170]11,32
960 [142]
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:thirteens":[160]15:[148]"thirteens",8:[128]