home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 73
/
073.d81
/
bits
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
8KB
|
260 lines
1 rem save"puss.v6.1",8
2 gosub20:deffns(x)=int(x/12):deffnv(x)=x-12*int(x/12)
3 dimx,y,z3,jj,ii,fr,j,f,rd,nc,j%,t,t2,tc,te,tt,wf,wt
5 printchr$(142);chr$(8):gosub111:goto400
8 rem==========fanfare=========
9 :
10 t=87:n$="251331421502421502"
11 pokef+6,96:pokef+24,15
12 fori=1to18step3
13 pokef+1,val(mid$(n$,i,2)):pokef+4,33
14 forj=1tot*val(mid$(n$,i+2,1)):next
15 pokef+4,0:next:x=3:y=12:w$="[176][192][192][192][192][192][192][192][174][157][157][157][157][157][157][157][157][157][221]you win[221][157][157][157][157][157][157][157][157][157][173][192][192][192][192][192][192][192][189]"
16 gosub66:return
17 rem ======creates screen save
18 :
20 for i=828to972:reada:pokei,a:next:return
22 data169,000,133,251,133,253,141
23 data055,003,141,057,003,141,059
24 data003,162,000,160,000,177,251
25 data145,253,200,192,000,208,247
26 data230,252,230,254,232,224,004
27 data208,238,173,056,003,133,252
28 data173,058,003,133,254,238,059
29 data003,174,059,003,224,002,208
30 data214,096,169,004,133,252,169
31 data192,133,254,169,216,141,056
32 data003,169,196,141,058,003,076
33 data060,003,169,192,133,252,169
34 data004,133,254,169,196,141,056
35 data003,169,216,141,058,003,076
36 data060,003,169,004,133,252,169
37 data200,133,254,169,216,141,056
38 data003,169,204,141,058,003,076
39 data060,003,169,200,133,252,169
40 data004,133,254,169,204,141,056
41 data003,169,216,141,058,003,076
42 data060,003,000,000,000
43 :
51 :
52 rem==========again?==============
53 :
54 x= 8:y=16:w$="[144] again? [157][157][157][157][157][157][157][157] (y/n) ":gosub66:goto62
55 :
56 rem==========any key-get a$=========
57 x=13:y=23:w$="[158][208]ress any key[145]":gosub66:goto62
58 x=13:y=23:w$="press any key[145]":gosub66
59 :
60 rem============get a$===========
61 :
62 geta$:ifa$=""then 90:return
64 rem=======print at=============
65 :
66 poke211,x:poke214,y:sys58732:printw$:return
68 :
69 ======dkwoody's card sound========
70 :
71 pokef+24,6:pokef+5,128:pokef+4,129:forii=1to50:next:pokef+4,128:pokef+5,0
72 pokef+24,0:pokef+24,15:pokef+4,129:pokef+4,128:return
90 ifjj=>nc-2then62
91 jj=jj+1:j%=jj+int(rnd(0)*(nc-jj)):temp=s(jj):s(jj)=s(j%):s(j%)=temp:goto62
106 :
107 rem===dim,define,once only stuff===
109 :
111 nc=48:dims(nc),va$(13),c(9),b(9,48):z9=0:f=54272
112 fori=0to3:reads$(i):readco$(i):next
113 fori=0to11:readva$(i):next
114 fori=1to9:readx(i),y(i):next:return
115 data"[216]","[144]","[218]","","[211]","","[193]","[144]", 2,3,4,5,6,7,8,9,10,j,q,k
116 data3,4,12,1,12,16,33,1,33,16,19,4,26,4,19,13,26,13
117 ch$="123456789hq"
119 c$="[176][192][192][192][192][174][157][157][157][157][157][157][221] [221][157][157][157][157][157][157][221] [176][174] [221][157][157][157][157][157][157][221] [221][221] [221]"
120 c$=c$+ "[157][157][157][157][157][157][221] [173][189] [221][157][157][157][157][157][157][221] [221][157][157][157][157][157][157][173][192][192][192][192][189]"+"[145][145][145][145][145][157][157][157][157][157]"
121 b$=c$+"[166][166][166][166][157][157][157][157][166][166][166][166][157][157][157][157][166][166][166][166][157][157][157][157][166][166][166][166][157][157][157][157][166][166][166][166]"
122 bl$=" [157][157][157][157][157][157] [157][157][157][157][157][157] [157][157][157][157][157][157] [157][157][157][157][157][157] [157][157][157][157][157][157]"
123 bl$=bl$+" [157][157][157][157][157][157] "
125 rem========shuffle & deal======
126 :
127 forj=0tonc-1:s(j)=j:next
128 forj=0tonc-2:j%=j+int(rnd(0)*(nc-j)):temp=s(j):s(j)=s(j%):s(j%)=temp:next
132 :
133 rem=======deal=============
134 :
135 for i=0to47:b(1,i+1)=s(i):next
136 c(1)=48:fori=2to9:c(i)=0:next:return
137 :
138 rem =====print card-deck is 1=====
139 :
140 j=c(i):x=x(i):y=y(i): if c(i)=0thenw$=bl$:goto66
141 ifi=1andwf=0and c(i)<>0thenw$=b$:goto66
142 iffnv(b(i,j))<>8then146
143 w$=c$+co$(fns(b(i,j)))+va$(fnv(b(i,j)))+"[157][157]"+s$(fns(b(i,j)))+""
144 w$=w$+ s$(fns(b(i,j)))+"[157][157]"+va$(fnv(b(i,j)))
145 goto148
146 w$=c$+co$(fns(b(i,j)))+va$(fnv(b(i,j)))+"[157]"+ s$(fns(b(i,j)))+""
147 w$=w$+ s$(fns(b(i,j)))+"[157]"+va$(fnv(b(i,j)))
148 gosub71:goto66
157 :
158 rem=======print board=======
159 :
160 poke53280,1:poke53281,1:print"[144][147]"chr$(142)tab(14)"2"tab(34)"4"
162 print"1 6 7
164 [153]" 8 9
166 print"35
168 x[178]x(1):y[178]y(1):w$[178]b$:[141]66:x[178]x(6):y[178]y(6):w$[178]c$[170]"acmd(NULL)(NULL)cmda":[141]66
169 x[178]x(7):y[178]y(7):w$[178]c$[170]"acmd(NULL)(NULL)cmda":[141]66
170 x[178]x(8):y[178]y(8):w$[178]c$[170]"stopacmdatnatncmda":[141]66
171 x[178]x(9):y[178]y(9):w$[178]c$[170]"stopacmd(NULL)(NULL)cmda":[141]66
172 x[178]3:y[178]19:w$[178]"h-help":[141]66:x[178]3:y[178]21:w$[178]"q-quit":[141]66
173 [142]
192 [139]c(i)[178]0[167]210:[137]500
194 [137]510
200 [141]140:[137]510
205 [129]i[178]1[164]11:[139]a$[178][202](ch$,i,1)[167]208
206 [130]
207 [145]z3[137]500,510
208 [145]z3[137]503,514
209 [143]=======illegal aside=======
210 x[178]3:y[178]13:w$[178]"illegal":[141]66:[129]i[178]1[164]1000:[130]:[137]500
219 :
220 [143]=====second screen=====
222 [153]"loadcont (NULL)(NULL)(NULL)(NULL) right$(NULL) len(NULL)(NULL)(NULL)val(NULL)"
223 [153]"def by (NULL)aurice mid$onesopen"
225 [153]:[153]" (NULL)(NULL)(NULL)(NULL) right$(NULL) len(NULL)(NULL)(NULL)val(NULL) is a traditional game"
226 [153]"of solitaire. (NULL)inning chances are
227 print"often quoted as one in three.
229 [153]:[153]" (NULL)he object of the game is to play
230 print"all of the cards to the center piles"
231 print"(6-9) in ascending order by color only.
234 [153]:[153]" lenards are drawn from the deck (1)
235 print"one at a time and each card must be"
236 print"played to one of the waste piles (2-5).
240 [153]:[153]" (NULL)nly the top card of each waste pile
242 print"is available for play to the center.
244 [153]:[153]" (NULL)ne redeal is allowed.
250 return
267 :
268 rem======play card=======
269 :
270 c(t2)=c(t2)+1:b(t2,c(t2))=b(fr,c(fr)):c(fr)=c(fr)-1:i=fr:gosub140
272 i=t2:gosub140:goto970
287 :
288 rem======exceptions======
289 :
290 ifi>9then504
291 ifi=1andrd=1then604
292 ifi<10andc(i)=0then210:goto500
293 wf=0:ifi=1thenwf=1
294 goto504
397 :
398 rem========start of program=======
399 :
400 poke53280,0:poke53281,0:print"[147][159]"
410 gosub60000:gosub117:gosub222:gosub127:gosub57
498 tt=0:jj=0:rd=0:gosub160
500 x=0:y=13:w$=" from ? [157][157]":gosub66:gosub62:z3=1:goto205
503 goto290
504 fr=i:onigoto200,192,192,192,192,210,210,210,210,1038,950
510 x=0:y=13:w$=" to ? [157][157]":gosub66:gosub62:z3=2:goto205
514 t2=i:onigoto210,700,700,700,700,800,800,800,800,1038,950
597 :
598 rem====redeal======
599 :
600 i=1:gosub140:tt=tt+1:iftt>=2then500
601 rd=1
602 x=3:y=15:w$="redeal":gosub66:goto500
604 fori=2to5:ifc(i)=0then612
608 forj=1toc(i):c(1)=c(1)+1:b(1,c(1))=b(i,j):next
612 next
616 fori=2to5:c(i)=0:x=x(i):y=y(i):w$=bl$:gosub66:gosub71
617 forj=1to500:next:next:rd=0
618 x=x(1):y=y(1):w$=b$:gosub66:x=3:y=15:w$=" ":gosub66:gosub71:goto500
697 :
698 rem======play to corners=========
699 :
700 iffr>1then210
702 wf=0:i=1:gosub140
704 c(t2)=c(t2)+1
706 b(t2,c(t2))=b(1,c(1)):c(1)=c(1)-1:i=t2:gosub140:goto970
797 :
798 rem======play to center==========
799 :
800 fc=b(fr,c(fr)):tc=b(t2,c(t2)):ct=c(t2)
801 iffr<>1then804
802 wf=0:i=1:gosub140
804 ont2-5goto810,810,814,814
810 iffns(b(fr,c(fr)))= 1orfns(b(fr,c(fr)))= 2then820
812 goto210:goto500
814 iffns(b(fr,c(fr)))= 0orfns(b(fr,c(fr)))= 3then850
816 goto210:goto500
820 ifc(t2)<>0then 830
824 iffnv(b(fr,c(fr)))<>0then210:goto500
828 goto270
830 iffnv(b(fr,c(fr)))-1<>fnv(b(t2,c(t2))) then210:goto500
834 goto270
850 ifc(t2)<>0then 860
854 iffnv(b(fr,c(fr)))<>0then210:goto500
858 goto270
860 iffnv(b(fr,c(fr)))-1<>fnv(b(t2,c(t2)))then210:goto500
864 goto270
947 :
948 rem===quit======
949 :
950 sys886:x=11:y=12:w$="[176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174][157][157][157][157][157][157][157][157][157]