mirror of
https://github.com/rfivet/BCG101.git
synced 2024-12-17 23:56:24 -05:00
Add POKER and YAHTZE.
This commit is contained in:
parent
7dcfd34c04
commit
29b448e9bb
410
dec/POKER.BAS
Normal file
410
dec/POKER.BAS
Normal file
@ -0,0 +1,410 @@
|
||||
1DIMA(15),B(10)
|
||||
2DEFFNA(X)=INT(10*RND(X))
|
||||
3DEFFNB(X)=X-100*INT(X/100)
|
||||
4PRINT"WELCOME TO THE HALLDEN CASINO. WE EACH HAVE $200"
|
||||
5PRINT"I WILL OPEN THE BETTING BEFORE THE DRAW; YOU OPEN AFTER"
|
||||
6PRINT"WHEN YOU FOLD, BET 0; TO CHECK, BET .5"
|
||||
7PRINT"ENOUGH TALK -- LET'S GET DOWN TO BUSINESS"
|
||||
8PRINT
|
||||
9LETO=1
|
||||
10LETC=200
|
||||
11LETS=200
|
||||
12LETP=0
|
||||
13RANDOM
|
||||
14PRINT
|
||||
15IFC<=5THEN367
|
||||
16PRINT"THE ANTE IS $5. I WILL DEAL"
|
||||
17PRINT
|
||||
18IFS>5THEN20
|
||||
19GOSUB383
|
||||
20LETP=P+10
|
||||
21LETS=S-5
|
||||
22LETC=C-5
|
||||
23FORZ=1TO10
|
||||
24GOSUB174
|
||||
25NEXTZ
|
||||
26PRINT"YOUR HAND:"
|
||||
27LETN=1
|
||||
28GOSUB185
|
||||
29LETN=6
|
||||
30LETI=2
|
||||
31GOSUB217
|
||||
32PRINT
|
||||
33IFI<>6THEN47
|
||||
34IFFNA(0)<=7THEN37
|
||||
35LETX=11100
|
||||
36GOTO42
|
||||
37IFFNA(0)<=7THEN40
|
||||
38LETX=11110
|
||||
39GOTO42
|
||||
40IFFNA(0)>=1THEN45
|
||||
41LETX=11111
|
||||
42LETI=7
|
||||
43LETZ=23
|
||||
44GOTO58
|
||||
45LETZ=1
|
||||
46GOTO51
|
||||
47IFU>=13THEN54
|
||||
48IFFNA(0)>=2THEN50
|
||||
49GOTO42
|
||||
50LETZ=0
|
||||
51LETK=0
|
||||
52PRINT"I CHECK"
|
||||
53GOTO62
|
||||
54IFU<=16THEN57
|
||||
55LETZ=2
|
||||
56IFFNA(0)>=1THEN58
|
||||
57LETZ=35
|
||||
58LETV=Z+FNA(0)
|
||||
59GOSUB348
|
||||
60PRINT"I'LL OPEN WITH "V
|
||||
61LETK=V
|
||||
62GOSUB305
|
||||
63GOSUB65
|
||||
64GOTO82
|
||||
65IFI<>3THEN76
|
||||
66PRINT
|
||||
67PRINT"I WIN"
|
||||
68LETC=C+P
|
||||
69PRINT"NOW I HAVE $"C"AND YOU HAVE $"S
|
||||
70PRINT"DO YOU WISH TO CONTINUE";
|
||||
71INPUTH$
|
||||
72IFH$="YES"THEN12
|
||||
73IFH$="NO"THEN410
|
||||
74PRINT"ANSWER YES OR NO, IDIOT"
|
||||
75GOTO70
|
||||
76IFI<>4THEN81
|
||||
77PRINT
|
||||
78PRINT"YOU WIN"
|
||||
79LETS=S+P
|
||||
80GOTO69
|
||||
81RETURN
|
||||
82PRINT
|
||||
83PRINT"NOW WE DRAW -- HOW MANY CARDS DO YOU WANT";
|
||||
84INPUTT
|
||||
85IFT=0THEN98
|
||||
86LETZ=10
|
||||
87IFT<4THEN90
|
||||
88PRINT"YOU CAN'T DRAW MORE THAN THREE CARDS"
|
||||
89GOTO84
|
||||
90PRINT"WHAT ARE THEIR NUMBERS"
|
||||
91FOR Q=1TOT
|
||||
92INPUTU
|
||||
93GOSUB173
|
||||
94NEXTQ
|
||||
95PRINT"YOUR NEW HAND:"
|
||||
96LETN=1
|
||||
97GOSUB185
|
||||
98LETZ=10+T
|
||||
99FORU=6TO10
|
||||
100IFINT(X/10^(U-6))<>10*INT(X/10^(U-5))THEN102
|
||||
101GOSUB173
|
||||
102NEXTU
|
||||
103PRINT
|
||||
104PRINT"I AM TAKING"Z-10-T"CARD";
|
||||
105IFZ=11+TTHEN109
|
||||
106PRINT"S"
|
||||
107PRINT
|
||||
108GOTO110
|
||||
109PRINT
|
||||
110LETN=6
|
||||
111LETV=I
|
||||
112LETI=1
|
||||
113GOSUB217
|
||||
114LETB=U
|
||||
115LETM=D
|
||||
116IFV<>7THEN119
|
||||
117LETZ=28
|
||||
118GOTO133
|
||||
119IFI<>6THEN122
|
||||
120LETZ=1
|
||||
121GOTO133
|
||||
122IFU>=13THEN127
|
||||
123LETZ=2
|
||||
124IFFNA(0)<>6THEN126
|
||||
125LETZ=19
|
||||
126GOTO133
|
||||
127IFU>=16THEN132
|
||||
128LETZ=19
|
||||
129IFFNA(0)<>8THEN131
|
||||
130LETZ=11
|
||||
131GOTO133
|
||||
132LETZ=2
|
||||
133LETK=0
|
||||
134GOSUB305
|
||||
135IFT<>.5THEN145
|
||||
136IFV=7THEN140
|
||||
137IFI<>6THEN140
|
||||
138PRINT"I'LL CHECK"
|
||||
139GOTO146
|
||||
140LETV=Z+FNA(0)
|
||||
141GOSUB348
|
||||
142PRINT"I'LL BET"V
|
||||
143LETK=V
|
||||
144GOSUB306
|
||||
145GOSUB65
|
||||
146PRINT
|
||||
147PRINT"NOW WE COMPARE HANDS"
|
||||
148LETJ$=H$
|
||||
149LETK$=I$
|
||||
150PRINT"MY HAND:"
|
||||
151LETN=6
|
||||
152GOSUB185
|
||||
153LETN=1
|
||||
154GOSUB217
|
||||
155PRINT
|
||||
156PRINT"YOU HAVE ";
|
||||
157LETK=D
|
||||
158GOSUB369
|
||||
159LETH$=J$
|
||||
160LETI$=K$
|
||||
161LETK=M
|
||||
162PRINT"AND I HAVE ";
|
||||
163GOSUB369
|
||||
164IFB>UTHEN67
|
||||
165IFU>BTHEN78
|
||||
166IFH$="A FLUS"THEN170
|
||||
167PRINT"THE HAND IS DRAWN"
|
||||
168PRINT"ALL $"P" REMAIN IN THE POT"
|
||||
169GOTO14
|
||||
170IFFNB(M)>FNB(D)THEN67
|
||||
171IFFNB(D)>FNB(M)THEN78
|
||||
172GOTO167
|
||||
173LETZ=Z+1
|
||||
174LETA(Z)=INT(1000*RND(0))
|
||||
175IFINT(A(Z)/100)>3THEN174
|
||||
176IFA(Z)-100*INT(A(Z)/100)>12THEN174
|
||||
177FORK=1TOZ-1
|
||||
178IFA(Z)=A(K)THEN174
|
||||
179NEXTK
|
||||
180IFZ<=10THEN184
|
||||
181LETN=A(U)
|
||||
182LETA(U)=A(Z)
|
||||
183LETA(Z)=N
|
||||
184RETURN
|
||||
185FORZ=NTON+4
|
||||
186PRINTZ"-- ";
|
||||
187GOSUB195
|
||||
188PRINT" OF";
|
||||
189GOSUB207
|
||||
190IFZ/2<>INT(Z/2)THEN192
|
||||
191PRINT
|
||||
192NEXTZ
|
||||
193PRINT
|
||||
194RETURN
|
||||
195LETK=FNB(A(Z))
|
||||
196IFK<>9THEN198
|
||||
197PRINT"JACK";
|
||||
198IFK<>10THEN200
|
||||
199PRINT"QUEEN";
|
||||
200IFK<>11THEN202
|
||||
201PRINT"KING";
|
||||
202IFK<>12THEN204
|
||||
203PRINT"ACE";
|
||||
204IFK>=9THEN206
|
||||
205PRINTK+2;
|
||||
206RETURN
|
||||
207LETK=INT(A(Z)/100)
|
||||
208IFK<>0THEN210
|
||||
209PRINT" CLUBS",
|
||||
210IFK<>1THEN212
|
||||
211PRINT" DIAMONDS",
|
||||
212IFK<>2THEN214
|
||||
213PRINT" HEARTS",
|
||||
214IFK<>3THEN216
|
||||
215PRINT" SPADES",
|
||||
216RETURN
|
||||
217LETU=0
|
||||
218FORZ=NTON+4
|
||||
219LETB(Z)=FNB(A(Z))
|
||||
220IFZ=N+4THEN223
|
||||
221IFINT(A(Z)/100)<>INT(A(Z+1)/100)THEN223
|
||||
222LETU=U+1
|
||||
223NEXTZ
|
||||
224IFU<>4THEN231
|
||||
225LETX=11111
|
||||
226LETD=A(N)
|
||||
227LETH$="A FLUS"
|
||||
228LETI$="H IN"
|
||||
229LETU=15
|
||||
230RETURN
|
||||
231FORZ=NTON+3
|
||||
232FORK=Z+1TON+4
|
||||
233IFB(Z)<=B(K)THEN239
|
||||
234LETX=A(Z)
|
||||
235LETA(Z)=A(K)
|
||||
236LETB(Z)=B(K)
|
||||
237LETA(K)=X
|
||||
238LETB(K)=A(K)-100*INT(A(K)/100)
|
||||
239NEXTK
|
||||
240NEXTZ
|
||||
241LETX=0
|
||||
242FORZ=NTON+3
|
||||
243IFB(Z)<>B(Z+1)THEN247
|
||||
244LETX=X+11*10^(Z-N)
|
||||
245LETD=A(Z)
|
||||
246GOSUB276
|
||||
247NEXTZ
|
||||
248IFX<>0THEN262
|
||||
249IFB(N)+3<>B(N+3)THEN252
|
||||
250LETX=1111
|
||||
251LETU=10
|
||||
252IFB(N+1)+3<>B(N+4)THEN262
|
||||
253IFU<>10THEN260
|
||||
254LETU=14
|
||||
255LETH$="STRAIG"
|
||||
256LETI$="HT"
|
||||
257LETX=11111
|
||||
258LETD=A(N+4)
|
||||
259RETURN
|
||||
260LETU=10
|
||||
261LETX=11110
|
||||
262IFU>=10THEN269
|
||||
263LETD=A(N+4)
|
||||
264LETH$="SCHMAL"
|
||||
265LETI$="TZ, "
|
||||
266LETU=9
|
||||
267LETX=11000
|
||||
268GOTO274
|
||||
269IFU<>10THEN272
|
||||
270IFI=1THEN274
|
||||
271GOTO275
|
||||
272IFU>12THEN275
|
||||
273IFFNB(D)>6THEN275
|
||||
274LETI=6
|
||||
275RETURN
|
||||
276IFU>=11THEN281
|
||||
277LETU=11
|
||||
278LETH$="A PAIR"
|
||||
279LETI$=" OF "
|
||||
280RETURN
|
||||
281IFU<>11THEN291
|
||||
282IFB(Z)<>B(Z-1)THEN287
|
||||
283LETH$="THREE"
|
||||
284LETI$=" "
|
||||
285LETU=13
|
||||
286RETURN
|
||||
287LETH$="TWO P"
|
||||
288LETI$="AIR, "
|
||||
289LETU=12
|
||||
290RETURN
|
||||
291IFU<>12THEN296
|
||||
292LETU=16
|
||||
293LETH$="FULL H"
|
||||
294LETI$="OUSE, "
|
||||
295RETURN
|
||||
296IFB(Z)<>B(Z-1)THEN301
|
||||
297LETU=17
|
||||
298LETH$="FOUR"
|
||||
299LETI$=" "
|
||||
300RETURN
|
||||
301LETU=16
|
||||
302LETH$="FULL H"
|
||||
303LETI$="OUSE, "
|
||||
304RETURN
|
||||
305LETG=0
|
||||
306PRINT"WHAT IS YOUR BET";
|
||||
307INPUTT
|
||||
308IFT-INT(T)=0THEN314
|
||||
309IFK<>0THEN312
|
||||
310IFG<>0THEN312
|
||||
311IFT=.5THEN341
|
||||
312PRINT"NO SMALL CHANGE, PLEASE"
|
||||
313GOTO306
|
||||
314IFS-G-T>=0THEN317
|
||||
315GOSUB383
|
||||
316GOTO306
|
||||
317IFT<>0THEN320
|
||||
318LETI=3
|
||||
319GOTO338
|
||||
320IFG+T>=KTHEN323
|
||||
321PRINT"IF YOU CAN'T SEE MY BET, THEN FOLD"
|
||||
322GOTO306
|
||||
323LETG=G+T
|
||||
324IFG=KTHEN338
|
||||
325IFZ<>1THEN342
|
||||
326IFG>5THEN330
|
||||
327IFZ>=2THEN335
|
||||
328LETV=5
|
||||
329GOTO342
|
||||
330IFZ=1THEN332
|
||||
331IFT<=25THEN335
|
||||
332LETI=4
|
||||
333PRINT"I FOLD"
|
||||
334RETURN
|
||||
335IFZ=2THEN343
|
||||
336PRINT"I'LL SEE YOU"
|
||||
337LETK=G
|
||||
338LETS=S-G
|
||||
339LETC=C-K
|
||||
340LETP=P+G+K
|
||||
341RETURN
|
||||
342IFG>3*ZTHEN335
|
||||
343LETV=G-K+FNA(0)
|
||||
344GOSUB348
|
||||
345PRINT"I'LL SEE YOU, AND RAISE YOU"V
|
||||
346LETK=G+V
|
||||
347GOTO306
|
||||
348IFC-G-V>=0THEN366
|
||||
349IFG<>0THEN352
|
||||
350LETV=C
|
||||
351RETURN
|
||||
352IFC-G>=0THEN336
|
||||
353IFO/2<>INT(O/2)THEN360
|
||||
354PRINT"WOULD YOU LIKE TO BUY BACK YOUR WATCH FOR $50";
|
||||
355INPUTJ$
|
||||
356IFJ$="NO"THEN360
|
||||
357LETC=C+50
|
||||
358LETO=O/2
|
||||
359RETURN
|
||||
360IFO/3<>INT(O/3)THEN367
|
||||
361PRINT"WOULD YOU LIKE TO BUY BACK YOUR TIE TACK FOR $50";
|
||||
362INPUTJ$
|
||||
363IFJ$="NO"THEN367
|
||||
364LETC=C+50
|
||||
365LETO=O/3
|
||||
366RETURN
|
||||
367PRINT"I'M BUSTED. CONGRATULATIONS"
|
||||
368STOP
|
||||
369PRINTH$;I$;
|
||||
370IFH$<>"A FLUS"THEN375
|
||||
371LETK=INT(K/100)
|
||||
372GOSUB208
|
||||
373PRINT
|
||||
374RETURN
|
||||
375LETK=FNB(K)
|
||||
376GOSUB196
|
||||
377IFH$="SCHMAL"THEN379
|
||||
378IFH$<>"STRAIG"THEN381
|
||||
379PRINT" HIGH"
|
||||
380RETURN
|
||||
381PRINT"S"
|
||||
382RETURN
|
||||
383PRINT
|
||||
384PRINT"YOU CAN'T BET WHAT YOU HAVEN'T GOT"
|
||||
385IFO/2=INT(O/2)THEN397
|
||||
386PRINT"WOULD YOU LIKE TO SELL YOUR WATCH";
|
||||
387INPUTJ$
|
||||
388IFJ$="NO"THEN397
|
||||
389IFFNA(0)>=7THEN393
|
||||
390PRINT"I'LL GIVE YOU $75 FOR IT"
|
||||
391LETS=S+75
|
||||
392GOTO395
|
||||
393PRINT"THAT'S A PRETTY CRUMMY WATCH - I'LL GIVE YOU $25"
|
||||
394LETS=S+25
|
||||
395LETO=O*2
|
||||
396RETURN
|
||||
397IFO/3=INT(O/3)THEN409
|
||||
398PRINT"WILL YOU PART WITH THAT DIAMOND TIE TACK";
|
||||
399INPUTJ$
|
||||
400IFJ$="NO"THEN408
|
||||
401IFFNA(0)>=6THEN405
|
||||
402PRINT"YOU ARE NOW $100 RICHER"
|
||||
403LETS=S+100
|
||||
404GOTO407
|
||||
405PRINT"IT'S PASTE. $25"
|
||||
406LETS=S+25
|
||||
407LETO=O*3
|
||||
408RETURN
|
||||
409PRINT"YOUR WAD IS SHOT. SO LONG, SUCKER"
|
||||
410END
|
558
dec/YAHTZE.BAS
Normal file
558
dec/YAHTZE.BAS
Normal file
@ -0,0 +1,558 @@
|
||||
1000 A(0)=5
|
||||
1010 FOR U=1 TO 5
|
||||
1020 A(U)=7
|
||||
1030 NEXT U
|
||||
1040 CHANGE A TO C$
|
||||
1060DIMA(15,15),T(15,15),F(15,15),S(15,15),L(15,15),K(15,15),H(15,15)
|
||||
1070 FOR I=1 TO 5
|
||||
1080 B(I)=0
|
||||
1090 Q(I)=0
|
||||
1100 A(I)=0
|
||||
1110 NEXT I
|
||||
1120 RANDOM
|
||||
1130 PRINT "HOW MANY PLAYERS [TYPE: '0' FOR INSTRUCTIONS]";
|
||||
1140 INPUT P
|
||||
1150 IF P>15 THEN 1180
|
||||
1160 IF P=0 THEN 4980
|
||||
1170 GO TO 1200
|
||||
1180 GOSUB 5710
|
||||
1190 GO TO 1130
|
||||
1200 IF P=.01 THEN 1220
|
||||
1210 GO TO 1240
|
||||
1220 GOSUB 5730
|
||||
1230 GO TO 1140
|
||||
1240 FOR I=1 TO P
|
||||
1250 A(1,I)=-5
|
||||
1260 T(1,I)=-5
|
||||
1270 T(2,I)=-5
|
||||
1280 F(1,I)=-5
|
||||
1290 F(2,I)=-5
|
||||
1300 S(1,I)=-5
|
||||
1310 T(3,I)=-5
|
||||
1320 F(3,I)=-5
|
||||
1330 F(4,I)=-5
|
||||
1340 S(2,I)=-5
|
||||
1350 L(1,I)=-5
|
||||
1360 Y(I)=-5
|
||||
1370 C(I)=-5
|
||||
1380 K(1,I)=0
|
||||
1390 K(I)=0
|
||||
1400 M(I)=0
|
||||
1410 PRINT "NAME";
|
||||
1420 INPUT N$(I)
|
||||
1430 IF N$(I)="WHAT?" THEN 1450
|
||||
1440 GO TO 1470
|
||||
1450 GOSUB 5580
|
||||
1460 GO TO 1410
|
||||
1470 NEXT I
|
||||
1480 R=0
|
||||
1490 R=R+1
|
||||
1495 IF R>13 THEN 6470
|
||||
1500 PRINT
|
||||
1510 PRINT
|
||||
1520 PRINT "ROUND";R
|
||||
1530 PRINT
|
||||
1540 FOR I=1 TO P
|
||||
1550 PRINT
|
||||
1560 PRINT
|
||||
1570 PRINT N$(I);"'S TURN"
|
||||
1580 FOR L=1TO5
|
||||
1590 A(L)=INT(6*RND(-1)+1)
|
||||
1600 NEXT L
|
||||
1605 GOSUB 1610
|
||||
1607 GO TO 1700
|
||||
1610 G=0
|
||||
1620 FOR X=1 TO 5
|
||||
1630 IF A(X)>=A(X+1) THEN 1680
|
||||
1640 H=A(X)
|
||||
1650 A(X)=A(X+1)
|
||||
1660 A(X+1)=H
|
||||
1670 G=1
|
||||
1680 NEXT X
|
||||
1685 IF G=1 THEN 1610
|
||||
1690 RETURN
|
||||
1700 PRINT "YOU HAVE A ";A(1);A(2);A(3);A(4);A(5)
|
||||
1710 PRINT "THIS IS YOUR 2ND OF 3 ROLLS,"
|
||||
1720 PRINT "HOW MANY DO YOU WANT TO CHANGE";
|
||||
1730 INPUT Z
|
||||
1740 IF Z=.01 THEN 1760
|
||||
1750 GO TO 1780
|
||||
1760 GOSUB 5600
|
||||
1770 GO TO 1730
|
||||
1780 IF Z=0 THEN 2620
|
||||
1790 IF Z=5 THEN 1890
|
||||
1800 FOR S=1 TO Z
|
||||
1810 PRINT "WHICH";
|
||||
1820 INPUT B(S)
|
||||
1830 IF B(S)=.01 THEN 1850
|
||||
1840 GO TO 1870
|
||||
1850 GOSUB 5620
|
||||
1860 GO TO 1810
|
||||
1870 NEXT S
|
||||
1880 GO TO 1930
|
||||
1890 FOR S=1 TO 5
|
||||
1900 A(S)=INT(6*RND(-1)+1)
|
||||
1910 NEXT S
|
||||
1920 GO TO 2050
|
||||
1930 FOR L=1 TO 5
|
||||
1940 FOR L1=1 TO 5
|
||||
1950 IF B(L)=L1 THEN 1970
|
||||
1960 GO TO 1980
|
||||
1970 A(L1)=Q(L1)
|
||||
1980 NEXT L1
|
||||
1990 NEXT L
|
||||
2000 FOR S=1 TO 5
|
||||
2010 IF A(S)=0 THEN 2030
|
||||
2020 GO TO 2040
|
||||
2030 A(S)=INT(6*RND(-1)+1)
|
||||
2040 NEXT S
|
||||
2050 GOSUB 1610
|
||||
2140 PRINT "YOU HAVE A ";A(1);A(2);A(3);A(4);A(5)
|
||||
2150 PRINT "THIS IS YOUR LAST ROLL,"
|
||||
2160 PRINT "HOW MANY DO YOU WANT TO CHANGE";
|
||||
2170 INPUT Z
|
||||
2180 IF Z=.01 THEN 2200
|
||||
2190 GO TO 2220
|
||||
2200 GOSUB 5600
|
||||
2210 GO TO 2170
|
||||
2220 IF Z=0 THEN 2620
|
||||
2230 IF Z=5 THEN 2360
|
||||
2240 FOR E=1 TO 5
|
||||
2250 B(E)=0
|
||||
2260 NEXT E
|
||||
2270 FOR S=1 TO Z
|
||||
2280 PRINT "WHICH";
|
||||
2290 INPUT B(S)
|
||||
2300 IF B(S)=.01 THEN 2320
|
||||
2310 GO TO 2340
|
||||
2320 GOSUB 5620
|
||||
2330 GO TO 2280
|
||||
2340 NEXT S
|
||||
2350 GO TO 2400
|
||||
2360 FOR S=1 TO 5
|
||||
2370 A(S)=INT(6*RND(-1)+1)
|
||||
2380 NEXT S
|
||||
2390 GO TO 2520
|
||||
2400 FOR L=1 TO 5
|
||||
2410 FOR L1=1 TO 5
|
||||
2420 IF B(L)=L1 THEN 2440
|
||||
2430 GO TO 2450
|
||||
2440 A(L1)=Q(L)
|
||||
2450 NEXT L1
|
||||
2460 NEXT L
|
||||
2470 FOR S=1 TO 5
|
||||
2480 IF A(S)=0 THEN 2500
|
||||
2490 GO TO 2510
|
||||
2500 A(S)=INT(6*RND(-1)+1)
|
||||
2510 NEXT S
|
||||
2520 GOSUB 1610
|
||||
2610 PRINT "YOU HAVE A ";A(1);A(2);A(3);A(4);A(5)
|
||||
2620 PRINT "HOW DO YOU WANT THIS ROUND SCORED";
|
||||
2630 INPUT Z$
|
||||
2640 IF Z$="WHAT?" THEN 2680
|
||||
2650 IF Z$="SUMMARY" THEN 2670
|
||||
2660 GO TO 2700
|
||||
2670 GOSUB 6140
|
||||
2675 GO TO 2620
|
||||
2680 GOSUB 5650
|
||||
2690 GO TO 2630
|
||||
2700 IF Z$="ACES" THEN 2850
|
||||
2710 IF Z$="TWOS" THEN 2940
|
||||
2720 IF Z$="THREES" THEN 3030
|
||||
2730 IF Z$="FOURS" THEN 3120
|
||||
2740 IF Z$="FIVES" THEN 3210
|
||||
2750 IF Z$="SIXES" THEN 3300
|
||||
2760 IF Z$="THREE OF A KIND" THEN 3390
|
||||
2770 IF Z$="FOUR OF A KIND" THEN 3440
|
||||
2780 IF Z$="FULL HOUSE" THEN 3520
|
||||
2790 IF Z$="SM. STRAIGHT" THEN 3620
|
||||
2800 IF Z$="LG. STRAIGHT" THEN 3660
|
||||
2810 IF Z$="YAHTZEE" THEN 3730
|
||||
2820 IF Z$="CHANCE" THEN 3820
|
||||
2830 IF Z$="ZERO" THEN 3890
|
||||
2840 GO TO 2620
|
||||
2850 IF A(1,I)<>-5 THEN 3870
|
||||
2860 A(1,I)=0
|
||||
2870 FOR S=1 TO 5
|
||||
2880 IF A(S)=1 THEN 2900
|
||||
2890 GO TO 2910
|
||||
2900 A(1,I)=A(1,I)+1
|
||||
2910 NEXT S
|
||||
2920 M(I)=A(1,I)
|
||||
2930 GO TO 4690
|
||||
2940 IF T(1,I)<>-5 THEN 3870
|
||||
2950 T(1,I)=0
|
||||
2960 FOR S=1 TO 5
|
||||
2970 IF A(S)=2 THEN 2990
|
||||
2980 GO TO 3000
|
||||
2990 T(1,I)=T(1,I)+2
|
||||
3000 NEXT S
|
||||
3010 M(I)=T(1,I)
|
||||
3020 GO TO 4690
|
||||
3030 IF T(2,I)<>-5 THEN 3870
|
||||
3040 T(2,I)=0
|
||||
3050 FOR S=1 TO 5
|
||||
3060 IF A(S)=3 THEN 3080
|
||||
3070 GO TO 3090
|
||||
3080 T(2,I)=T(2,I)+3
|
||||
3090 NEXT S
|
||||
3100 M(I)=T(2,I)
|
||||
3110 GO TO 4690
|
||||
3120 IF F(1,I)<>-5 THEN 3870
|
||||
3130 F(1,I)=0
|
||||
3140 FOR S=1 TO 5
|
||||
3150 IF A(S)=4 THEN 3170
|
||||
3160 GO TO 3180
|
||||
3170 F(1,I)=F(1,I)+4
|
||||
3180 NEXT S
|
||||
3185 M(I)=F(1,I)
|
||||
3190 GO TO 4690
|
||||
3210 IF F(2,I)<>-5 THEN 3870
|
||||
3220 F(2,I)=0
|
||||
3230 FOR S=1 TO 5
|
||||
3240 IF A(S)=5 THEN 3260
|
||||
3250 GO TO 3270
|
||||
3260 F(2,I)=F(2,I)+5
|
||||
3270 NEXT S
|
||||
3280 M(I)=F(2,I)
|
||||
3290 GO TO 4690
|
||||
3300 IF S(1,I)<>-5 THEN 3870
|
||||
3310 S(1,I)=0
|
||||
3320 FOR S=1 TO 5
|
||||
3330 IF A(S)=6 THEN 3350
|
||||
3340 GO TO 3360
|
||||
3350 S(1,I)=S(1,I)+6
|
||||
3360 NEXT S
|
||||
3370 M(I)=S(1,I)
|
||||
3380 GO TO 4690
|
||||
3390 IF T(3,I)<>-5 THEN 3870
|
||||
3400 T(3,I)=0
|
||||
3410 T(3,I)=A(1)+A(2)+A(3)+A(4)+A(5)
|
||||
3420 M(I)=T(3,I)
|
||||
3430 GO TO 4690
|
||||
3440 IF F(3,I)<>-5 THEN 3870
|
||||
3450 IF A(1)<>A(4) THEN 4960
|
||||
3460 IF A(2)<>A(3) THEN 4960
|
||||
3470 F(3,I)=0
|
||||
3480 F(3,I)=A(1)+A(2)+A(3)+A(4)+A(5)
|
||||
3490 M(I)=F(3,I)
|
||||
3500 F(3,I)=0
|
||||
3510 GO TO 4690
|
||||
3520 IF F(4,I)<>-5 THEN 3870
|
||||
3530 IF A(1)<>A(2) THEN 4960
|
||||
3540 IF A(4)<>A(5) THEN 4960
|
||||
3550 IF A(3)<>A(2) THEN 3570
|
||||
3560 GO TO 3590
|
||||
3570 IF A(3)<>A(4) THEN 4960
|
||||
3580 GO TO 3590
|
||||
3590 F(4,I)=25
|
||||
3600 M(I)=F(4,I)
|
||||
3610 GO TO 4690
|
||||
3620 IF S(2,I)<>-5 THEN 3870
|
||||
3630 S(2,I)=30
|
||||
3640 M(I)=S(2,I)
|
||||
3650 GO TO 4690
|
||||
3660 IF L(1,I)<>-5 THEN 3870
|
||||
3670 IF A(1)<>A(5)+4 THEN 4960
|
||||
3680 IF A(2)<>A(4)+2 THEN 4960
|
||||
3690 IF A(3)<>A(5)+2 THEN 4960
|
||||
3700 L(1,I)=40
|
||||
3710 M(I)=L(1,I)
|
||||
3720 GO TO 4690
|
||||
3730 IF Y(I)<>-5 THEN 3870
|
||||
3740 FOR O=1 TO 5
|
||||
3750 FOR O1=1 TO 5
|
||||
3760 IF A(O)<>A(O1) THEN 4960
|
||||
3770 NEXT O1
|
||||
3780 NEXT O
|
||||
3790 Y(I)=50
|
||||
3800 M(I)=Y(I)
|
||||
3810 GO TO 4690
|
||||
3820 IF C(I)<>-5 THEN 3870
|
||||
3830 C(I)=A(1)+A(2)+A(3)+A(4)+A(5)
|
||||
3540
|
||||
3850 M(I)=C(I)
|
||||
3860 GO TO 4690
|
||||
3870 GOSUB 4650
|
||||
3880 GO TO 2620
|
||||
3890 PRINT "WHAT DO YOU WANT TO ZERO";
|
||||
3900 INPUT Z$
|
||||
3920 IF Z$="SUMMARY" THEN 3940
|
||||
3930 GO TO 3970
|
||||
3940 GOSUB 6140
|
||||
3945 GO TO 2620
|
||||
3950 GOSUB 5680
|
||||
3960 GO TO 3900
|
||||
3970 IF Z$="ACES" THEN 4110
|
||||
3980 IF Z$="TWOS" THEN 4150
|
||||
3990 IF Z$="THREES" THEN 4190
|
||||
4000 IF Z$="FOURS" THEN 4230
|
||||
4010 IF Z$="FIVES" THEN 4270
|
||||
4020 IF Z$="SIXES" THEN 4310
|
||||
4030 IF Z$="THREE OF A KIND" THEN 4350
|
||||
4040 IF Z$="FOUR OF A KIND" THEN 4390
|
||||
4050 IF Z$="FULL HOUSE" THEN 4430
|
||||
4060 IF Z$="SM. STRAIGHT" THEN 4470
|
||||
4070 IF Z$="LG. STRAIGHT" THEN 4510
|
||||
4080 IF Z$="YAHTZEE" THEN 4550
|
||||
4090 IF Z$="CHANCE" THEN 4590
|
||||
4100 GO TO 3890
|
||||
4110 IF A(1,I)<>-5 THEN 4630
|
||||
4120 A(1,I)=0
|
||||
4130 M(I)=A(1,I)
|
||||
4140 GO TO 4690
|
||||
4150 IF T(1,I)<>-5 THEN 4630
|
||||
4160 T(1,I)=0
|
||||
4170 M(I)=T(1,I)
|
||||
4180 GO TO 4690
|
||||
4190 IF T(2,I)<>-5 THEN 4630
|
||||
4200 T(2,I)=0
|
||||
4210 M(I)=T(2,I)
|
||||
4220 GO TO 4690
|
||||
4230 IF F(1,I)<>-5 THEN 4630
|
||||
4240 F(1,I)=0
|
||||
4250 M(I)=F(1,I)
|
||||
4260 GO TO 4690
|
||||
4270 IF F(2,I)<>-5 THEN 4630
|
||||
4280 F(2,I)=0
|
||||
4290 M(I)=F(2,I)
|
||||
4300 GO TO 4690
|
||||
4310 IF S(1,I)<>-5 THEN 4630
|
||||
4320 S(1,I)=0
|
||||
4330 M(I)=S(1,I)
|
||||
4340 GO TO 4690
|
||||
4350 IF T(3,I)<>-5 THEN 4630
|
||||
4360 T(3,I)=0
|
||||
4370 M(I)=T(3,I)
|
||||
4380 GO TO 4690
|
||||
4390 IF F(3,I)<>-5 THEN 4630
|
||||
4400 F(3,I)=0
|
||||
4410 M(I)=F(3,I)
|
||||
4420 GO TO 4690
|
||||
4430 IF F(4,I)<>-5 THEN 4630
|
||||
4440 F(4,I)=0
|
||||
4450 M(I)=F(4,I)
|
||||
4460 GO TO 4690
|
||||
4470 IF S(2,I)<>-5 THEN 4630
|
||||
4480 S(2,I)=0
|
||||
4490 M(I)=S(2,I)
|
||||
4500 GO TO 4690
|
||||
4510 IF L(1,I)<>-5 THEN 4630
|
||||
4520 L(1,I)=0
|
||||
4530 M(I)=L(1,I)
|
||||
4540 GO TO 4690
|
||||
4550 IF Y(I)<>-5 THEN 4630
|
||||
4560 Y(I)=0
|
||||
4570 M(I)=Y(I)
|
||||
4580 GO TO 4690
|
||||
4590 IF C(I)<>-5 THEN 4630
|
||||
4600 C(I)=0
|
||||
4610 M(I)=C(I)
|
||||
4620 GO TO 4690
|
||||
4630 GOSUB 4650
|
||||
4640 GOTO 2620
|
||||
4650 PRINT "YOU HAVE ALREADY USED ";Z$;" AS A CATEGORY";C$
|
||||
4660 PRINT
|
||||
4670 RETURN
|
||||
4680 GOTO 2620
|
||||
4690 PRINT N$(I);" YOU GET A SCORE OF ";M(I);" FOR THIS ROUND"
|
||||
4700 GO TO 5750
|
||||
4710 NEXT I
|
||||
4720 PRINT
|
||||
4730 FOR J=1 TO P
|
||||
4740 IF M(J)=A(1,J) THEN 4810
|
||||
4750 IF M(J)=T(1,J) THEN 4810
|
||||
4760 IF M(J)=T(2,J) THEN 4810
|
||||
4770 IF M(J)=F(1,J) THEN 4810
|
||||
4780 IF M(J)=F(2,J) THEN 4810
|
||||
4790 IF M(J)=S(1,J) THEN 4810
|
||||
4800 GO TO 4920
|
||||
4810 K(1,J)=K(1,J)+M(J)
|
||||
4820 GO TO 4830
|
||||
4830 IF K(1,J)>=63 THEN 4860
|
||||
4840 K(J)=K(J)+M(J)
|
||||
4850 GO TO 4930
|
||||
4860 K(1,J)=K(1,J)+35
|
||||
4870 PRINT C$;N$(J);" HAS ACCUMULATED AT LEAST 63 POINTS"
|
||||
4880 PRINT "IN THE FIRST SIX CATEGORIES."
|
||||
4890 PRINT "HE SCORES A BONUS OF 35 POINTS!";C$
|
||||
4900 K(J)=K(J)+M(J)
|
||||
4910 GO TO 4930
|
||||
4920 K(J)=K(J)+M(J)
|
||||
4930 PRINT N$(J);" HAS ";K(J);" POINTS"
|
||||
4940 NEXT J
|
||||
4950 GO TO 1490
|
||||
4960 PRINT "IT IS ILLEGAL TO USE ";Z$;" THIS ROUND";C$
|
||||
4970 GO TO 2620
|
||||
4980 PRINT
|
||||
4990 PRINT
|
||||
5000 PRINT
|
||||
5010 PRINT "INSTRUCTIONS FOR PLAYING YAHTZEE";C$
|
||||
5020 PRINT
|
||||
5030 PRINT "YAHTZEE MAY BE PLAYED BY UP TO 15 PEOPLE."
|
||||
5040 PRINT "THE OBJECT OF THE GAME IS TO GET THE HIGHEST SCORE"
|
||||
5050 PRINT "EACH PLAYER ON HIS TURN RECEIVES FROM THE COMPUTER"
|
||||
5060 PRINT "THE VALUES OF THE 5 PSEUDO-DICE. HE MAY THEN ROLL"
|
||||
5070 PRINT "AS MANY OF THEM AS HE WANTS TO AGAIN. HOWEVER,"
|
||||
5080 PRINT "HE IS ENTITLED UP TO BUT NO MORE THAN THREE ROLLS"
|
||||
5090 PRINT "OF THE DICE."
|
||||
5100 PRINT " YOU TELL THE COMPUTER MANY DICE YOU"
|
||||
5110 PRINT "WANT TO CHANGE, THEN TELL IT WHICH ONES IN THE FOL-"
|
||||
5120 PRINT "LOWING MANNER:"
|
||||
5130 PRINT
|
||||
5140 PRINT " TYPE: '1' FOR THE 1ST DIE, '2' FOR THE 2ND, ETC"
|
||||
5150 PRINT " AFTER THE THIRD ROLL THE PLAYER MUST DECIDE HOW"
|
||||
5160 PRINT "HE WANTS TO SCORE HIS FIVE DICE."
|
||||
5170 PRINT "TYPING 'SUMMARY' WILL SHOW WHAT CATEGORIES"
|
||||
5180 PRINT "HAVE BEEN USED. OTHERWISE,"
|
||||
5190 PRINT "YOU HAVE 13 CHOICES, TYPE 1 OF THE FOLLOWING"
|
||||
5200 PRINT "DEPENDING ON HOW YOU WANT TOUR DICE SCORED."
|
||||
5210 PRINT "THE CHOICES ARE:"
|
||||
5220 PRINT "ACES,TWOS,THREES,FOURS,FIVES,SIXES"
|
||||
5230 PRINT "THREE OF A KIND,FOUR OF A KIND,FULL HOUSE, SM. STRAIGHT,"
|
||||
5240 PRINT "LG. STRAIGHT, YAHTZEE,CHANCE."
|
||||
5250 PRINT "WHAT THE COMPUTER WILL DO:"
|
||||
5260 PRINT "FOR ACES IT WILL COUNT AND ADD ALL YOUR ONES."
|
||||
5270 PRINT "FOR TWOS IT WILL COUNT AND ADD ALL YOUR TWOS."
|
||||
5280 PRINT "THE SAME IS TRUE THROUGH THE SIXES"
|
||||
5290 PRINT "THREE OF A KIND WILL TOTAL ALL OF THE DICE PRO-"
|
||||
5300 PRINT "VIDED THAT YOU HAVE THREE OF A KIND"
|
||||
5310 PRINT "FOUR OF A KIND IS THE SAME AS THREE OF A KIND EXCEPT"
|
||||
5320 PRINT "THAT YOU MUST HAVE FOUR OF A KIND"
|
||||
5330 PRINT "FULL HOUSE [3 OF ONE NO. AND 2 OF ANOTHER] WILL YIELD"
|
||||
5340 PRINT "25 POINTS. SM. STRAIGHT WILL GIVE YOU 30 POINTS BUT"
|
||||
5350 PRINT "YOU MUST HAVE A SEQUENCE OF FOUR."
|
||||
5360 PRINT "LG.STRAIGHT WILL YIELD 40 POINTS BUT YOU MUST HAVE A SE-"
|
||||
5370 PRINT "QUENCE OF FIVE."
|
||||
5380 PRINT "YAHTZEE WILLL GIVE 50 POINTS IF YOU HAVE FIVE OF A KIND."
|
||||
5390 PRINT "CHANCE WILL TOTAL ALL OF YOUR DICE AND USE THAT AS YOUR SCORE."
|
||||
5400 PRINT "CHANCE IS USEFUL WHEN YOU DON'T HAVE ANYTHING WORTH SCORING."
|
||||
5410 PRINT "ANOTHER CATEGORY, 'ZERO' WILL ZERO OUT A CATEGORY"
|
||||
5420 PRINT "IF YOU DON'T HAVE ANYTHING WORTH SCORING"
|
||||
5430 PRINT "BUT HAVE PERHAPS ALREAOY USED YOUR CHANCE."
|
||||
5440 PRINT
|
||||
5450 PRINT "IF YOUR ACCUMULATED SCORE OF THE FIRST SIX CATEGORIES"
|
||||
5460 PRINT "EVER REACHES AT LEAST 63 POINTS YOU WILL RECEIVE"
|
||||
5470 PRINT "A BONUS OF 35 POINTS!";C$
|
||||
5480 PRINT
|
||||
5490 PRINT "FOR INSTRUCTIONS DURING THE RUNNING OF THE PROGRAM"
|
||||
5500 PRINT "TYPE 'WHAT?' WHEN THE COMPUTER ASKS FOR A WORD, OR,"
|
||||
5510 PRINT"'.01' WHEN IT WANTS A NUMBER, AND YOU WILL RECEIVE"
|
||||
5520 PRINT "FURTHER NOTES RELATED TO WHAT THE COMPUTER ASKED FOR."
|
||||
5530 PRINT
|
||||
5540 PRINT
|
||||
5550 PRINT
|
||||
5560 PRINT "GOOD LUCK!!!!!";C$
|
||||
5570 GO TO 1070
|
||||
5580 PRINT "WHAT DO YOU WANT ONE OF THE PLAYERS CALLED BY"
|
||||
5600 PRINT "HOW MANY DICE DO YOU WANT TO ROLL AGAIN";
|
||||
5610 RETURN
|
||||
5620 PRINT "WHICH DIE DO YOU WANT TO CHANGE"
|
||||
5630 PRINT "TYPE: '1' FOR THE 1ST DIE, '2' FOR THE 2ND DIE, ETC."
|
||||
5640 RETURN
|
||||
5650 PRINT "IN WHICH CATEGORY DO YOU WANT THIS ROUND SCORED"
|
||||
5660 PRINT "TYPING: 'SUMMARY' WILL TELL YOU WHICH CATEGORIES YOU HAVE USED";
|
||||
5670 RETURN
|
||||
5680 PRINT "WHICH CATEGORY DO YOU WANT ZEROED"
|
||||
5690 GO TO 5660
|
||||
5710 PRINT "A MAXIMUM OF 15 PLAYERS IS ALLOWED"
|
||||
5720 RETURN
|
||||
5730 PRINT "HOW MANY PEOPLE WISH TO PLAY";
|
||||
5740 RETURN
|
||||
5750 IF Z$="ACES" THEN 5880
|
||||
5760 IF Z$="TWOS" THEN 5900
|
||||
5770 IF Z$="THREES" THEN 5920
|
||||
5780 IF Z$="FOURS" THEN 5940
|
||||
5790 IF Z$="FIVES" THEN 5960
|
||||
5800 IF Z$="SIXES" THEN 5980
|
||||
5810 IF Z$="THREE OF A KIND" THEN 6000
|
||||
5820 IF Z$="FOUR OF A KIND" THEN 6020
|
||||
5830 IF Z$="FULL HOUSE" THEN 6040
|
||||
5840 IF Z$="SM. STRAIGHT" THEN 6060
|
||||
5850 IF Z$="LG. STRAIGHT" THEN 6080
|
||||
5860 IF Z$="YAHTZEE" THEN 6100
|
||||
5870 IF Z$="CHANCE" THEN 6120
|
||||
5880 H(I,R)=1
|
||||
5890 GO TO 4710
|
||||
5900 H(I,R)=2
|
||||
5910 GO TO 4710
|
||||
5920 H(I,R)=3
|
||||
5930 GO TO 4710
|
||||
5940 H(I,R)=4
|
||||
5950 GO TO 4710
|
||||
5960 H(I,R)=5
|
||||
5970 GO TO 4710
|
||||
5980 H(I,R)=6
|
||||
5990 GO TO 4710
|
||||
6000 H(I,R)=7
|
||||
6010 GO TO 4710
|
||||
6020 H(I,R)=8
|
||||
6030 GO TO 4710
|
||||
6040 H(I,R)=9
|
||||
6050 GO TO 4710
|
||||
6060 H(I,R)=10
|
||||
6070 GO TO 4710
|
||||
6080 H(I,R)=11
|
||||
6090 GO TO 4710
|
||||
6100 H(I,R)=12
|
||||
6110 GO TO 4710
|
||||
6120 H(I,R)=13
|
||||
6130 GO TO 4710
|
||||
6140 PRINT N$(I);" HAS USED THE FOLLOWING CATEGORIES:"
|
||||
6150 FOR S=1 TO (R-1)
|
||||
6160 IF H(I,S)>7 THEN 6180
|
||||
6170 ON H(I,S) GO TO 6190,6210,6230,6250,6270,6290,6310
|
||||
6180 ON H(I,F)-7 GO TO 6330,6350,6370,6390,6410,6430
|
||||
6190 PRINT "ACES, ";
|
||||
6200 GO TO 6440
|
||||
6210 PRINT "TWOS, ";
|
||||
6220 GO TO 6440
|
||||
6230 PRINT "THREES, ";
|
||||
6240 GO TO 6440
|
||||
6250 PRINT "FOURS, ";
|
||||
6260 GO TO 6440
|
||||
6270 PRINT "FIVES, ";
|
||||
6280 GO TO 6440
|
||||
6290 PRINT "SIXES, ";
|
||||
6300 GO TO 6440
|
||||
6310 PRINT "THREE OF A KIND, ";
|
||||
6320 GO TO 6440
|
||||
6330 PRINT "FOUR OF A KIND, ";
|
||||
6340 GO TO 6440
|
||||
6350 PRINT "FULL HOUSE, ";
|
||||
6360 GO TO 6440
|
||||
6370 PRINT "SM. STRAIGHT, ";
|
||||
6380 GO TO 6440
|
||||
6390 PRINT "LG. STRAIGHT, ";
|
||||
6400 GO TO 6440
|
||||
6410 PRINT "YAHTZEE, ";
|
||||
6420 GO TO 6440
|
||||
6430 PRINT "CHANCE, ";
|
||||
6440 NEXT S
|
||||
6445 PRINT
|
||||
6446 PRINT "HE HAS ";K(I);" POINTS,"
|
||||
6447 PRINT "AND ";K(1,I);" OF THE 65 POINTS NEEDED FOR THE BONUS";
|
||||
6450 PRINT "."
|
||||
6460 RETURN
|
||||
6470 G=0
|
||||
6480 FOR X=1 TO P
|
||||
6490 IF S(X)>=S(X+1) THEN 6540
|
||||
6500 H=S(X)
|
||||
6510 S(X)=S(X+1)
|
||||
6520 S(X+1)=H
|
||||
6530 G=1
|
||||
6540 NEXT X
|
||||
6550 IF G=1 THEN 6470
|
||||
6560 PRINT "THE GAME IS OVER."
|
||||
6570 PRINT
|
||||
6571 FOR X=1 TO P
|
||||
6572 IF K(X)=S(X) THEN 6580
|
||||
6573 NEXT X
|
||||
6580 PRINT "THE WINNER IS ";N$(1);" WITH ";K(1);" POINTS."
|
||||
6585 IF P=1 THEN 9999
|
||||
6586 PRINT "OTHER FINAL SCORES ARE:"
|
||||
6590 FOR Y=1 TO P
|
||||
6600 IF K(Y)=S(X) THEN 6620
|
||||
6610 PRINT N$(Y);" FINISHES WITH ";K(Y);" POINTS."
|
||||
6620 NEXT Y
|
||||
9999 END
|
Loading…
Reference in New Issue
Block a user