-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathaceyducey (1).bas
105 lines (103 loc) · 2.34 KB
/
aceyducey (1).bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
10 CLS
20 PRINT "ACEY DUCEY CARD GAME"
30 PRINT "CREATIVE COMPUTING"
40 PRINT "MORRISTOWN, NJ"
50 PRINT ""
60 PRINT " - press a key -"
70 RANDOMIZE
80 GOSUB "WAIT1":CLS
90 PRINT "ACEY-DUCEY RULES 2 CARDS"
100 PRINT "ARE DEALT FACE UP."
110 PRINT "WILL THE NEXT CARD BE"
120 PRINT "A VALUE BETWEEN THESE 2?"
130 PRINT "NO BET, INPUT 0"
140 GOSUB "WAIT1"
150 N=100
160 "START" Q=100
170 "MAIN00" CLS: GOSUB "CASH"
180 GOTO "MAIN01"
190 "ADDWIN" Q=Q+M
200 GOTO "MAIN00"
210 "DECWIN" Q=Q-M
220 GOTO "MAIN00"
230 "MAIN01" CLS: GOSUB "CASH"
240 "RND00" A= INT (14* RND (1))+2
250 IF A<2 THEN "RND00"
260 IF A>14 THEN "RND00"
270 "RND01" B= INT (14* RND (1))+2
280 IF B<2 THEN "RND01"
290 IF B>14 THEN "RND01"
300 IF A>=B THEN "RND00"
310 IF A<11 THEN U$= STR$ (A)
320 IF A=11 THEN U$="J"
330 IF A=12 THEN U$="Q"
340 IF A=13 THEN U$="K"
350 IF A=14 THEN U$="A"
360 X=1:Y=2
370 GOSUB "DCARD"
380 X=25
390 GOSUB "DCARD"
400 IF B<11 THEN T$=STR$ (B)
410 IF B=11 THEN T$="J"
420 IF B=12 THEN T$="Q"
430 IF B=13 THEN T$="K"
440 IF B=14 THEN T$="A"
450CLS: GOSUB "CASH"
460 X=1: S$=U$: GOSUB "FCARD"
470 S$=T$:X=25: GOSUB "FCARD"
480 "INBET" GOSUB "CASH"
490 LOCATE 0,5:M=0
500 INPUT "ENTER BET: ";M
505 LOCATE 0,5:PRINT " "
510 IF M=0 THEN "MAIN01"
520 IF M<=Q THEN "RND02"
530 GOTO "INBET"
540 "RND02" C= INT (14* RND (1))+2
550 IF C<2 THEN "RND02"
560 IF C>14 THEN "RND02"
570 S$= STR$(A)
580 IF C=11 THEN S$="J"
590 IF C=12 THEN S$="Q"
600 IF C=13 THEN S$="K"
610 IF C=14 THEN S$="A"
620 X=54
630 GOSUB "FCARD": LOCATE 15,3
640 "CALC" IF C>A THEN "CALC0"
650 GOTO "ULOSE"
660 "CALC0" IF C>=B THEN "ULOSE"
670 PRINT "YOU WIN!": GOSUB "WAIT1"
680 GOTO "ADDWIN"
690 "ULOSE" PRINT "YOU LOSE": GOSUB "WAIT1"
700 IF M<Q THEN "DECWIN"
710 GOSUB "CASH": LOCATE 0,5
720 INPUT "TRY AGAIN (YES OR NO)";S$
730 IF S$="YES" THEN "START"
740 CLS: PRINT "OK, HOPE YOU HAD FUN!"
750 END
760 "WAIT1" AA$= INKEY$
770 IF AA$="" THEN "WAIT1"
780 RETURN
790 "DCARD"
800 LINE (X,Y)-(X+18,Y)
810 LINE -(X+18,Y+25)
820 LINE -(X,Y+25)
830 LINE -(X,Y)
840 LINE (X+2,Y+2)-(X+16,Y+2)
850 LINE -(X+16,Y+23)
860 LINE -(X+2,Y+23)
870 LINE -(X+2,Y+2)
880 PAINT (X+6,Y+6),3
890 RETURN
900 "FCARD"
910 LINE (X,Y)-(X+18,Y)
920 LINE -(X+18,Y+25)
930 LINE -(X,Y+25)
940 LINE -(X,Y)
950 PX=X/6+1:PY=Y/8+1
960 LOCATE PX,PY: PRINT S$
970 RETURN
980 "CASH" LOCATE 18,0
990 PRINT "CASH"
1000 LOCATE 18,1:PRINT STR$(Q)
1010 RETURN