home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er Special 17
/
64er_Magazin_Sonderheft_17_19xx_Markt__Technik_de_Side_A.d64
/
skat.bas
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
11KB
|
436 lines
1 rem *************
2 rem * *
3 rem * s k a t *
4 rem * *
5 rem *************
6 rem
7 z(1)=0:z(2)=0:z(3)=0:s=0
8 poke53280,14:poke53281,14
9 ifs>0thenprint"[144]":goto21
10 print"[147][144][216][216][216][216][216][216][216][216] [193][193][193] [193][193][193] [211][211][211][211][211][211][211][211] [218][218][218][218][218][218][218][218]";
11 print"[144][216][216][216][216][216][216][216][216] [193][193][193] [193][193][193] [211][211][211][211][211][211][211][211] [218][218][218][218][218][218][218][218]";
12 print"[144][216][216] [193][193][193] [193][193][193] [211][211] [211][211] [218][218] "
13 print"[144][216][216] [193][193][193] [193][193][193] [211][211] [211][211] [218][218] "
14 print"[144][216][216][216][216][216][216][216][216] [193][193][193][193][193][193] [211][211][211][211][211][211][211][211] [218][218] "
15 print"[144][216][216][216][216][216][216][216][216] [193][193][193][193][193][193] [211][211][211][211][211][211][211][211] [218][218] "
16 print"[144] [216][216] [193][193][193] [193][193][193] [211][211] [211][211] [218][218] "
17 print"[144] [216][216] [193][193][193] [193][193][193] [211][211] [211][211] [218][218] "
18 print"[144][216][216][216][216][216][216][216][216] [193][193][193] [193][193][193] [211][211] [211][211] [218][218] "
19 print"[144][216][216][216][216][216][216][216][216] [193][193][193] [193][193][193] [211][211] [211][211] [218][218] "
20 gosub162
21 dima$(32),a(32),b$(2,32),q(32),v(16),k(15),y(12):a=rnd(-ti)
22 fort=1to16:readv(t):next
23 fort=1to4:readj(t):next
24 fort=0to15:readk(t):next
25 fort=1to4:readu(t):next
26 fort=1to4:readn(t):next
27 fort=0to31:reada:poke828+t,a:next
28 fort=1to32:reada$(t):next
29 fory=1to3
30 fort=1to10
31 a=int(rnd(1)*32)+1
32 ifa(a)>0then31
33 a(a)=y:nextt,y
34 ifs=0theninput"[147][144]welcher spieler teilt aus ";s:ifs<1ors>3thens=0:goto34
35 df=s
36 y=1:x=-5:ifs=2then de=3
37 ifs=3thende=2
38 gosub329:print"spieler"aa"hat das 1. reizen gewonnen.":gosub118:op=s
39 fg=5:ifaa=1ands=2thenns=-1:de=2:gosub332:goto44
40 ifaa=1ands=3thens=-1:de=3:gosub332:goto44
41 ifaa=2ands=1thens=0:de=2:gosub332:goto44
42 ifaa=3ands=1thens=0:de=3:gosub332:goto44
43 ifaa=2ands=3oraa=3ands=2thens=1:gosub332
44 gosub117:s=op:sw=sw(aa)+96:print"spieler"aa"spielt alleine !"
45 ifaa=1thengosub118:goto48
46 print""chr$(sw(aa))" ist trumpf !":gosub305
47 ol=9:v=aa:gosub337:ol=0:gosub118:goto74
48 sys828
49 fort=1to32
50 ifa(t)=0thena(t)=aa
51 ifa(t)=1thengosub163
52 next:y=1:x=-5
53 gosub134:input"1.welche karte soll weg ";i$:gosub202:p$=i$
54 b$(1,1)=i$
55 gosub134:input"2.welche karte soll weg ";i$:gosub202
56 b$(1,2)=i$:q(1)=2:a=0
57 fort=1to28
58 ifa(t)>1then60
59 ifa$(t)=p$ora$(t)=i$thena=a+1
60 next:ifa=2then62
61 gosub116:q(1)=0:goto53
62 fort=1to28
63 ifa(t)>1then65
64 ifa$(t)=p$ora$(t)=i$thena(t)=0
65 next
66 sys828:gosub166
67 gosub134:input"willst du grand spielen ";o$:ifo$<>"n"ando$<>"j"then67
68 ifo$="j"thenfg=9:v=1:gosub337:fg=0:sw(1)=0:sw=0:as(1)=0:rw(1)=ty*24
69 ifo$="j"then74
70 gosub134:input"welche farbe ist trumpf ";o$
71 ifo$<>"[193]"ando$<>"[211]"ando$<>"[218]"ando$<>"[216]"then70
72 ol=9:sw(1)=asc(o$)-96:v=1:gosub337:ol=0
73 sw=asc(o$)
74 fortt=1to3
75 s=s+1:ifs=4thens=1
76 ifs=1thengosub169:goto79
77 iftt=1thensys828:y=1:x=-5:gosub166:gosub178:goto79
78 gosub268
79 c(s)=k:k$(tt)=a$(k):l(tt)=s
80 z$=a$(k):d=d+6:x=d:y=16:yy=9:gosub143
81 next
82 gosub118:hz=0:gosub392:gosub421
83 ifasc(k$(1))=asc(k$(2))andasc(k$(2))=asc(k$(3))then111
84 t=asc(k$(1)):tt=asc(right$(k$(1),1))
85 v=asc(right$(k$(2),1))
86 ift=asc(k$(2))andtt>vthenll=l(1)
87 ift=asc(k$(2))andtt<vthenll=l(2)
88 v=asc(right$(k$(3),1))
89 ift=asc(k$(3))andtt>vthenll=l(1)
90 ift=asc(k$(3))andtt<vthenll=l(3)
91 h=0:forv=1to3
92 ifasc(right$(k$(v),1))=78thenh=h+1:j=v
93 next:ifh>1then120
94 ifh=1thenll=l(j):goto99
95 h=0:forv=1to3
96 ifasc(k$(v))=swthenh=h+1:j=v
97 next:ifh=1thenll=l(j)
98 ifh=2then128
99 ifll=aathent=1:goto101
100 t=2
101 forv=1to3
102 q(t)=q(t)+1:b$(t,q(t))=k$(v)
103 next:d=0:ifll=0thens=ll:goto105
104 s=ll-1
105 forv=1to32
106 ifa$(v)=k$(1)ora$(v)=k$(2)ora$(v)=k$(3)thena(v)=0
107 next:a=0
108 forv=1to32:ifa(v)=1thena=a+1
109 next:ifa=0then211
110 goto74
111 tt=0
112 forv=1to3
113 qq=asc(right$(k$(v),1))
114 ifqq>ttthentt=asc(right$(k$(v),1)):ee=v
115 next:ll=l(ee):goto99
116 gosub134:print"fehler[146]":forkk=1to2000:next:return
117 print"spieler"aa"hat das 2. reizen gewonnen.":return
118 gosub134:print"[144] taste druecken !":poke198,0:wait198,1
119 gosub134:return
120 gg=0:forv=1to3
121 h=asc(k$(v)):j=asc(right$(k$(v),1))
122 ifj<78then127
123 ifh=216thenll=l(v):goto99
124 ifh=193andgg<3thengg=3:ll=l(v)
125 ifh=211andgg<2thengg=2:ll=l(v)
126 ifh=218andgg<1thengg=1:ll=l(v)
127 next:goto99
128 forv=1to3
129 h=asc(k$(v)):j=asc(right$(k$(v),1))
130 ifh=swandgg<jthengg=j:ll=l(v)
131 ifh=swandgg<jthengg=j:ll=l(v)
132 next:h=0:j=0
133 goto99
134 poke211,0:poke214,23:sys58640:poke781,23:sys59903:return
135 data18,20,22,23,24,27,30,33,36,40,44,45,48,50,55,60,1,2,4,8,0,2,2,3,3,2
136 data2,4,4,2,2,3,3,2,2,5,122,115,97,120,120,97,115,122,169,147,32,210,255
137 data162,8,169,1,157,223,219,189,82,3,157,223,7,202,16,242,96,11,18,21,12
138 data12,19,15,6,20,96
139 data"[218]7","[218]8","[218]9","[218]d","[218]k","[218]l","[218]m"
140 data"[211]7","[211]8","[211]9","[211]d","[211]k","[211]l","[211]m"
141 data"[193]7","[193]8","[193]9","[193]d","[193]k","[193]l","[193]m"
142 data"[216]7","[216]8","[216]9","[216]d","[216]k","[216]l","[216]m","[218]n","[211]n","[193]n","[216]n"
143 f$=right$(z$,1)
144 z$=left$(z$,1)
145 poke211,0:poke214,y-1:sys58640
146 iff$="l"thenf$="z"
147 iff$="m"thenf$="a"
148 iff$="n"thenf$="b"
149 ifz$="[218]"orz$="[211]"thenz$=""+z$+"[144]":f$=""+f$+"[144]"
150 d$="":ifx<>35thend$=chr$(13)
151 printspc(x)"[213][192][192][192][201]"d$;
152 printspc(x)"[221]"f$" "f$"[221]"d$;
153 printspc(x)"[221] [221]"d$;
154 printspc(x)"[221] "z$" [221]"d$;
155 printspc(x)"[221] [221]"d$;
156 printspc(x)"[221]"f$" "f$"[221]"d$;
157 printspc(x)"[202][192][192][192][203]"
158 ifyy<>9thenreturn
159 ifs=aathenprint"";:hz=tt
160 yy=0:printspc(x)"s #"s""
161 return
162 gosub134:printspc(30)"krullsoft";:return
163 z$=a$(t)
164 x=x+5:ifx=40theny=y+7:x=0
165 gosub143:return
166 fort=1to32
167 ifa(t)=1thengosub163
168 next:y=1:x=-5:return
169 iftt=1thensys828:y=1:x=-5:gosub166
170 gosub134:input"welche karte soll gesetzt werden ";i$:gosub202
171 a=0:fort=1to32
172 ifa(t)<>1then174
173 ifi$=a$(t)thena=9
174 next:ifa=0thengosub116:goto170
175 forw=1to32:ifa$(w)=i$thenk=w:goto177
176 nextw
177 return
178 k=0:cc=0:rr=100:ifaa<>sthengosub411:ifrr<100thenreturn
179 ifaa<>sthen191
180 fort=1to32
181 ifa(t)<>sthen190
182 ifasc(right$(a$(t),1))=78thenk=t:return
183 forj9=1to4
184 forai=1to3:ifs=aithen186
185 ify(ai*4-4+j9)=1andasc(a$(t))-96=u(j9)then190
186 nextai,j9
187 j=asc(a$(t)):h=asc(right$(a$(t),1))
188 ifh=77andj<>swthenk=t:return
189 ifj<>swandrr>hthenrr=h:k=t
190 nextt:ifrr<100thenreturn
191 rr=100
192 fort=1to28
193 ifa(t)<>sthen196
194 j=asc(a$(t)):h=asc(right$(a$(t),1))
195 ifj<>swandrr>hthenrr=h:k=t
196 next:ifrr<100thenj=0:h=0:return
197 rr=0
198 fort=1to32
199 h=asc(right$(a$(t),1))
200 ifa(t)=sandh>rrthenrr=h:k=t
201 next:h=0:return
202 q$=right$(i$,1)
203 ifq$="z"thenq$="l":goto207
204 ifq$="a"thenq$="m":goto207
205 ifq$="b"thenq$="n":goto207
206 return
207 i$=left$(i$,1)+q$:return
208 fort=1to28
209 ifa(t)=sandasc(a$(t))=swthenk=t:return
210 next:return
211 sys828:printspc(15)"auswertung"
212 ifcc<>5thena=0
213 ifq(1)=0then222
214 fort=1toq(1)
215 b$=right$(b$(1,t),1)
216 ifb$="d"thena=a+3
217 ifb$="k"thena=a+4
218 ifb$="l"thena=a+10
219 ifb$="m"thena=a+11
220 ifb$="n"thena=a+2
221 next
222 gosub255
223 print"spieler"aa"hat"a"punkte !"
224 print"spieler";:n=0
225 fort=1to3
226 ift=aathen229
227 printt;:n=n+1
228 ifn=1thenprint"und";
229 next:print"haben"120-a"punkte!"
230 b$=" ":a$(0)="-":a$(1)="[144]":a$(2)="[144]+":
231 ifa<30thenrw(aa)=rw(aa)+as(aa)
232 ifa<61thenrw(aa)=(0-rw(aa))*2
233 f=0-rw(aa):i(4)=rw(aa)
234 fort=1to3
235 ift=aathenz(aa)=z(aa)+rw(aa):goto237
236 z(t)=z(t)+f
237 next
238 i(1)=z(1):i(2)=z(2):i(3)=z(3)
239 h=4:c=4:gosub264
240 i(1)=z(1)-z(3):k(1)=i(1)
241 i(2)=z(2)-z(1):k(2)=i(2)
242 i(3)=z(3)-z(1):k(3)=i(3)
243 h=3:c=6:gosub264
244 i(1)=z(1)-z(2):k(1)=k(1)+i(1)
245 i(2)=z(2)-z(3):k(2)=k(2)+i(2)
246 i(3)=z(3)-z(2):k(3)=k(3)+i(3)
247 c=7:gosub264
248 i(1)=k(1):i(2)=k(2):i(3)=k(3)
249 c=9:gosub264
250 s=df
251 s=s+1:ifs=4thens=1
252 gosub118
253 print"[147][153][154]7z(1)="z(1)"[157]:z(2)="z(2)"[157]:z(3)="z(3)"[157]:s="s
254 print"run";:poke631,13:poke632,13:poke198,2:end
255 print"spieler:[194] 1 [221] 2 [221] 3 [221]summe[194]"
256 print" [171][192][192][192][192][192][219][192][192][192][192][192][219][192][192][192][192][192][219][192][192][192][192][192][179]"
257 print" [194] [194] [194] [194] [194]"
258 print" [171][192][192][192][192][192][219][192][192][192][192][192][219][192][192][192][192][192][219][192][192][192][192][192][189]"
259 print" [221] [221] [221] [221]"
260 print" [221] [221] [221] [221]"
261 print" [221]-----[221]-----[221]-----[221]"
262 print" [221] [221] [221] [221]"
263 return
264 fora=1toh
265 a$=str$(i(a)):b=len(a$):a$=right$(a$,b-1):b=b-1
266 c$=a$(sgn(i(a))+1)+left$(b$,4-b)+a$
267 poke214,c:poke211,9+(a-1)*6:sys58640:printc$:next:return
268 v=asc(k$(1)):h2=asc(right$(k$(1),1)):k=0:l=0:ifh2=78thenv=sw
269 fort=1to28
270 ifa(t)<>sthen274
271 j=asc(a$(t)):q2=asc(right$(a$(t),1))
272 ifv=jthenl=9:ifq2>h2thenk=t:gosub432:ifcc=9thenreturn
273 ifcc=8then387
274 next:q3=0:q4=0
275 ifhz>0andtt=3thenq3=asc(right$(k$(hz),1)):q4=asc(right$(k$(3-hz),1))
276 ifl=9then295
277 b=100
278 fort=32to1step-1
279 ifa(t)<>sthen282
280 j=asc(a$(1)):q=asc(right$(a$(t),1))
281 ifq<bthenb=q:k=t
282 next
283 iftt=3thenifv<>swandq4>q3andv=asc(k$(2))ands<>aathen384
284 iftt=3thenifv<>swandhz=1andasc(k$(2))=swands<>aathen384
285 iftt=3thenifhz=1andasc(right$(k$(2),1))=78andv<>swands<>aathen384
286 iftt=3theno8=asc(right$(k$(2),1))
287 iftt=3thenifv=asc(k$(2))andv<>swando8>75ands=aathengosub208
288 ifh2<75andv<>swthenreturn
289 ifv=0andh2<78thenreturn
290 j7=k:ifv<>swthengosub208:ifj7<>kthenreturn
291 fort=28to32:ifa(t)<>sthen293
292 ifasc(right$(a$(t),1))=78thenk=t:return
293 next:iftt=3thenifq4>q3andv=asc(k$(2))ands<>aathen384
294 return
295 iftt=3thenifq4>q3andv=asc(k$(2))ands<>aathen387
296 iftt=3thenifv<>swandhz=1andasc(k$(2))=swands<>aathen387
297 iftt=3thenifhz=1andasc(right$(k$(2),1))=78andv<>swands<>aathen387
298 h=100:fort=1to28
299 ifa(t)<>sthen302
300 q=asc(right$(a$(t),1))
301 ifv=asc(a$(t))andq<hthenh=q:k=t
302 next:ifv=swandh2>74andh2<78then291
303 ifv=swandasc(right$(a$(k),1))>68then291
304 return
305 fort=1to32:ifa(t)=0thena(t)=aa
306 next
307 fort=1to4:c(t)=0:next
308 fort=1to28
309 ifa(t)<>aathen315
310 a=asc(a$(t))-96
311 ifa=122thenc(1)=c(1)+1
312 ifa=115thenc(2)=c(2)+1
313 ifa=97thenc(3)=c(3)+1
314 ifa=120thenc(4)=c(4)+1
315 next:a=0
316 fort=1to4
317 ifc(t)<3andc(t)>0thenc(t)=c(t)-1:gosub325:ifa<2then317
318 ifa=2thenreturn
319 next
320 fort=1to28:ifa(t)<>aaorasc(a$(t))-96=sw(aa)then324
321 h=asc(right$(a$(t),1))
322 ifh=55orh=56orh=57thena=a+1:q(1)=q(1)+1:b$(1,q(1))=a$(t):a(t)=0
323 ifa=2thenreturn
324 next:return
325 forkk=1to28:ifa(kk)<>aathen328
326 ifasc(a$(kk))-96=u(t)andasc(a$(kk))-96<>sw(aa)thenko=9
327 ifko=9thenko=0:a=a+1:q(1)=q(1)+1:b$(1,q(1))=a$(kk):a(kk)=0:return
328 next:return
329 y=1:x=-5:gosub166
330 print" rechne aus,wie hoch du reizen kannst !"
331 gosub118
332 ab=s+2:ifab=4thenab=1
333 ifab=5thenab=2
334 print"[147]"spc(17)"reizen"
335 iffg=5thenfg=0:goto361
336 forv=1to3
337 forj=1to8:c(j)=0:next:h=0
338 fort=1to32
339 ifa(t)<>vthen346
340 ifasc(right$(a$(t),1))=78thenh=4
341 a=asc(a$(t))-96
342 ifa=120thenc(h+1)=c(h+1)+1
343 ifa=97thenc(h+2)=c(h+2)+1
344 ifa=115thenc(h+3)=c(h+3)+1
345 ifa=122thenc(h+4)=c(h+4)+1
346 h=0:next
347 forj=1to4
348 ifc(j)>hthenh=c(j):a=j
349 next:ifol=9then351
350 sw(v)=n(a):ifv=1thensw(1)=120
351 a=0:forj=5to8
352 ifc(j)=1thena=a+j(j-4)
353 next:a=k(a):ifv=1anda=0thena=5
354 ty=a:iffg=9thenreturn
355 ifsw(v)=120thenrw(v)=12*a:as(v)=12
356 ifsw(v)=97thenrw(v)=11*a:as(v)=11
357 ifsw(v)=115thenrw(v)=10*a:as(v)=10
358 ifsw(v)=122thenrw(v)=9*a:as(v)=9
359 ifol=9thenreturn
360 next
361 ifab=1then374
362 ifab=2then365
363 ifrw(2)>rw(3)thenaa=2:return
364 aa=3:return
365 ifrw(de)=0thenprint"ich reize nich !":aa=1:return
366 fort=1to16
367 ifv(t)>rw(de)then373
368 print"hast du"v(t)" punkte "
369 input"(j/n)";a$:ifa$<>"j"anda$<>"n"thenprint"[145]";:goto369
370 ifa$="n"thenaa=de:return
371 ifa$="j"andv(t)>rw(1)thenprint"so viel hast du nicht !":aa=de:return
372 next:aa=de:return
373 print"ich habe nicht mehr !":aa=1:return
374 print"fange an zu reizen (18-60)"
375 print"willst du nicht mehr weiter reizen,dann gib 0 ein.":h=0
376 fort=1to16
377 a=h:input"zahl ";h:ifh=0thenprint"dann nicht !":aa=de:return
378 forv=1to16:ifv(v)=hthen380
379 nextv:print"fehler ![146]":h=a:goto377
380 ifh>rw(1)thenprint"so viel hast du nicht !":aa=de:return
381 ifh<=athenprint"fehler ![146]":goto377
382 ifh>rw(de)thenprint"so viel habe ich nicht !":aa=1:return
383 nextt:aa=1:return
384 b=0:fort=1to28:ifa(t)<>sthen386
385 ifasc(right$(a$(t),1))>bthenk=t:b=asc(right$(a$(t),1))
386 next:return
387 fort=28to1 step-1
388 ifa(t)<>sthen390
389 ifv=asc(a$(t))thenk=t:return
390 next:ifv=swandh2>74andh2<78then291
391 return
392 a=0:j1=asc(k$(1)):j2=asc(k$(2)):j3=asc(k$(3)):i1=asc(right$(k$(1),1))
393 i2=asc(right$(k$(2),1)):i3=asc(right$(k$(3),1)):h=0
394 ifsw=0andi1=78andi2<78thenrr(l(2))=1:return
395 ifsw=0andi1=78andi3<78thenrr(l(3))=1:return
396 ifj1=swsori1=78then402
397 ifj1<>j2thena=2:gosub405
398 ifj1<>j3thena=3:gosub405
399 ifi2=78thena=2:gosub405
400 ifi3=78thena=3:gosub405
401 return
402 ifj2<>swandi2<>78thena=2:gosub408
403 ifj3<>swandi3<>78thena=3:gosub408
404 return
405 h=l(a):fort=1to4
406 ifu(t)=j1-96theny(4*h-4+t)=1
407 next:return
408 h=l(a):fort=1to4
409 ifu(t)=sw-96theny(4*h-4+t)=1
410 next:return
411 fort=1to32
412 ifa(t)<>sthen420
413 ifasc(right$(a$(t),1))=78thenrr=0:k=t:return
414 forj9=1to4
415 ify(aa*4-4+j9)=1andasc(a$(t))-96=u(j9)then420
416 nextj9
417 j=asc(a$(t)):h=asc(right$(a$(t),1))
418 ifh=77andj<>swthenk=t:rr=0:return
419 ifj<>swandrr>hthenrr=h:k=t
420 nextt:return
421 fort=1to3:ifl(t)=1thencc=t
422 next:a$=k$(cc)
423 ifrr(1)=1andasc(right$(a$,1))=78then429
424 fort=1to4
425 ify(t)=1andasc(a$)-96=u(t)andasc(right$(a$,1))<78then428
426 ify(t)=1andu(t)=sw-96andasc(right$(a$,1))=78then428
427 next:return
428 gosub134:print"[145][145][145][145][145][145][145][145][145]du hast gemogelt !":goto430
429 gosub134:print"[145][145][145][145][145][145][145][145][145]du hattest ja doch noch einen buben !"
430 gosub118:cc=5:q(1)=0:ifaa=1thena=0:goto211
431 a=120:goto211
432 cc=0:iftt=2thencc=9:return
433 a1=asc(right$(k$(1),1)):a2=asc(right$(k$(2),1)):a3=asc(right$(a$(k),1))
434 ifasc(k$(1))=asc(k$(2))anda3>a2anda3>a1anda2<78andv<>swthencc=8:return
435 return