10 REM PROGRAM NAME 'ACEY'
20 REM THIS PROGRAM WAS DEVELOPED ON A H-8 WITH 48K OF MEMORY, A H-17, AND A H-19
30 REM  AUTHOR:  JOSEPH L. FUSARO
40 REM           3 ROXBURY COURT
50 REM           FARMINGVILLE, N.Y. 11738
60 REM           516-732-3281
70 REM  DEVELOPEMENT DATE APRIL 4, 1980.
80 CLEAR 200:I=RND(-PEEK(8219))
90 DEFINT A-C:DEFINT E-Z
100 DIM T$(3),V(3),D(51)
110 FOR I = 1  TO 3
120 READ V(I)
130 T$(I)=CHR$(V(I))
140 NEXT I
150 DATA 114,95,122
160 PRINT  CHR$(27)+"E"
170 PRINT "HI, MY NAME IS FUZZY. WHAT'S YOUR NAME "
180 INPUT NA$
190 PRINT "OK ";NA$;" DO YOU WANT INSTRUCTIONS "
200 INPUT QA$
210 IF  LEFT$(QA$,1)<>"Y"  THEN 230
220 GOSUB 6200:INPUT BE$
230 PRINT "ALL RIGHT ";NA$;" LET'S PLAY. GOOD LUCK"
240 FOR I = 1  TO 1000:NEXT I
250 LX=33:LY=40
260 MX=33:MY=64
270 RX=33:RY=89
280 MO=0
290 FOR I = 0  TO 51:D(I)=I:NEXT I
300 T$(0)=CHR$(32):REM                                 Space Key
310 E$=CHR$(27):  REM                              E$ = Escape key
320 E1$=E$+"E":   REM                              E1$= Erase Page
330 EL$=E$+"l":   REM                              EL$= Erase Entire Line
340 K$=E$+"K":    REM                              K$ = Erase to end of line
350 F$=E$+"F":    REM                              F$ = Enter Graphics Mode
360 G$=E$+"G":    REM                              G$ = Exit  Graphics Mode
370 Z$=E$+"z":    REM                              Z$ = Power-up Reset
380 P$=E$+"p":    REM                              P$ = Enter Reverse Video
390 Q$=E$+"q":    REM                              Q$ = Exit  Reverse Video
400 X1$=E$+"x1":  REM                              X1$= Enable 25th Line
410 Y1$=E$+"Y1":  REM                              Y1$= Disable 25th Line
420 X5$=E$+"x5":  REM                              X5$= Cursor Off
430 Y5$=E$+"y5":  REM                              Y5$= Cursor On
440 X3$=E$+"x3":  REM                              X3$= Enter Hold Screen Mode
450 Y3$=E$+"y3":  REM                              Y3$= Exit Hold Screen Mode
460 Y$=E$+"Y":    REM                              Y$ = Direct Cursor Addressing
470 PRINT E1$;X3$
480 PRINT "CARDS ARE BEING SHUFFLED"
490 GOSUB 5990:   REM                              Shuffle Cards
500 PRINT E1$
510 PRINT F$;P$;X5$;
520 X=LX:Y=LY
530 GOSUB 1520:   REM                              Print Left Border
540 X=MX:Y=MY
550 GOSUB 1520:   REM                              Print Middle Border
560 X=RX:Y=RY
570 GOSUB 1520:   REM                              Print Right Border
580 X=LX+2:Y=LY+2
590 GOSUB 6090:   REM                              Change To Ranks
600 AC=0
610 GOSUB 1360:   REM                              Print Rank Left Card
620 LC=N
630 X=LX+10:Y=LY+2
640 GOSUB 6140:   REM                              Change To Suits
650 GOSUB 1290:   REM                              Print Suit Left Card
660 IF A > 51  THEN  GOSUB 6160
670 X=RX+2:Y=RY+2
680 GOSUB 6090:   REM                              Change To Ranks
690 GOSUB 1360:   REM                              Print Rank Right Card
700 RC=N
710 X=RX+10:Y=RY+2
720 GOSUB 6140:   REM                              Change To Suits
730 GOSUB 1290:   REM                              Print Suit Right Card
740 IF A > 51  THEN  GOSUB 6160
750 GOSUB 6420:   REM                              Clear Last 4 Lines
760 IF LC <> RC  THEN 800
770 PRINT "RANKS ARE THE SAME. NO BET."
780 GOSUB 6480
790 GOTO 580
800 INPUT "ENTER BET ";BE$
810 IF  LEFT$(BE$,4)="QUIT"  THEN 5930
820 IF AC=0  THEN 850
830 IF  LEFT$(BE$,1)<>"H"  AND  LEFT$(BE$,1)<>"L"  THEN 1140
840 BE=VAL(MID$(BE$,2)):GOTO 860
850 BE=VAL(BE$)
860 GOSUB 6480
870 IF BE=0  THEN 580
880 X=MX+2:Y=MY+2
890 GOSUB 6090:   REM                              Change To Ranks
900 GOSUB 1390:   REM                              Print Rank Middle Card
910 MC=N
920 X=MX+10:Y=MY+2
930 GOSUB 6140:   REM                              Change To Suits
940 GOSUB 1320:   REM                              Print Suit Middle Card
950 IF A > 51  THEN  GOSUB 6160
960 GOSUB 6420:   REM                              Clear Last 4 Lines
970 IF AC = 0  THEN 1010
980 IF  LEFT$(BE$,1) <> "H"  THEN 1010
990 IF LC = 1  THEN 1180
1000 IF RC = 1  THEN 1200
1010 IF MC>LC  AND MC<RC  OR MC<LC  AND MC>RC  THEN 1160
1020 MO=MO-BE
1030 PRINT "BET WAS ";:PRINT  USING "$$##,###";BE;:PRINT ". ";
1040 IF MO < 0  THEN 1100
1050 IF MO = 0  THEN 1120
1060 PRINT "YOU ARE WINNING ";:PRINT  USING "$$##,###";MO
1070 IF MO => 25000  OR MO =< -25000  THEN 5900
1080 GOSUB 6500
1090 GOTO 1220
1100 PRINT "YOU ARE LOSING ";:PRINT  USING "$$##,###";ABS(MO)
1110 GOTO 1070
1120 PRINT "YOU ARE EVEN. VERY GOOD."
1130 GOTO 1070
1140 IF  VAL(LEFT$(BE$,1)) = 0  THEN  GOSUB 6480:GOTO 580
1150 PRINT "YOU LOSE.":BE=VAL(BE$):GOTO 1020
1160 MO=MO+BE
1170 GOTO 1030
1180 LC=LC+13
1190 GOTO 1010
1200 RC=RC+13
1210 GOTO 1010
1220 GOSUB 6480
1230 FOR K = 1  TO 500:  NEXT K
1240 X=MX+2:Y=MY+2
1250 GOSUB 5430
1260 X=MX+10:Y=MY+2
1270 GOSUB 5430
1280 GOTO 580
1290 P=11:R=5
1300 REM CALL SUIT CLEANUP
1310 GOSUB 5430
1320 IF S = 1  THEN  GOSUB 1660:  RETURN:  REM HEART SUIT
1330 IF S = 2  THEN  GOSUB 2120:  RETURN:  REM DIAMOND SUIT
1340 IF S = 3  THEN  GOSUB 2480:  RETURN:  REM CLUB SUIT
1350 GOSUB 2860:                RETURN:  REM SPADE SUIT
1360 P=4:R=4
1370 REM CALL NUMBER CLEANUP
1380 GOSUB 5430
1390 IF N = 1   THEN  GOSUB 3200:  RETURN:  REM ACE
1400 IF N = 2   THEN  GOSUB 3380:  RETURN:  REM TWO
1410 IF N = 3   THEN  GOSUB 3550:  RETURN:  REM THREE
1420 IF N = 4   THEN  GOSUB 3730:  RETURN:  REM FOUR
1430 IF N = 5   THEN  GOSUB 3900:  RETURN:  REM FIVE
1440 IF N = 6   THEN  GOSUB 4070:  RETURN:  REM SIX
1450 IF N = 7   THEN  GOSUB 4240:  RETURN:  REM SEVEN
1460 IF N = 8   THEN  GOSUB 4410:  RETURN:  REM EIGHT
1470 IF N = 9   THEN  GOSUB 4580:  RETURN:  REM NINE
1480 IF N = 10  THEN  GOSUB 4750:  RETURN:  REM TEN
1490 IF N = 11  THEN  GOSUB 4920:  RETURN:  REM JACK
1500 IF N = 12  THEN  GOSUB 5070:  RETURN:  REM QUEEN
1510 GOSUB 5260:                 RETURN:  REM KING
1520 REM PRINT BORDER OF CARD
1530 FOR I = 0  TO 17
1540 IF I = 0  OR I = 17  THEN 1610
1550 H$=CHR$(X+I)+CHR$(Y)
1560 I$=CHR$(X+I)+CHR$(Y+15)
1570 PRINT Y$;H$+T$(0);
1580 PRINT Y$;I$+T$(0);
1590 NEXT I
1600 RETURN
1610 FOR J = 0  TO 15
1620 H$=CHR$(X+I)+CHR$(Y+J)
1630 PRINT Y$;H$+T$(0);
1640 NEXT J
1650 GOTO 1590
1660 REM **HEART**
1670 REM PRINT LINE #1
1680 PRINT Y$;CHR$(X)+CHR$(Y+2)+T$(1);
1690 PRINT Y$;CHR$(X)+CHR$(Y+3)+T$(0);
1700 PRINT Y$;CHR$(X)+CHR$(Y+4)+T$(2);
1710 PRINT Y$;CHR$(X)+CHR$(Y+7)+T$(1);
1720 PRINT Y$;CHR$(X)+CHR$(Y+8)+T$(0);
1730 PRINT Y$;CHR$(X)+CHR$(Y+9)+T$(2);
1740 REM PRINT LINE #2
1750 FOR M = 2  TO 4
1760 PRINT Y$;CHR$(X+1)+CHR$(Y+M)+T$(0);
1770 NEXT M
1780 PRINT Y$;CHR$(X+1)+CHR$(Y+5)+T$(2);
1790 PRINT Y$;CHR$(X+1)+CHR$(Y+6)+T$(1);
1800 FOR M = 7  TO 9
1810 PRINT Y$;CHR$(X+1)+CHR$(Y+M)+T$(0);
1820 NEXT M
1830 REM PRINT LINE #3
1840 PRINT Q$;
1850 PRINT Y$;CHR$(X+2)+CHR$(Y+2)+T$(2);
1860 PRINT P$;
1870 FOR M = 3  TO 8
1880 PRINT Y$;CHR$(X+2)+CHR$(Y+M)+T$(0);
1890 NEXT M
1900 PRINT Q$;
1910 PRINT Y$;CHR$(X+2)+CHR$(Y+9)+T$(1);
1920 REM PRINT LINE #4
1930 PRINT Y$;CHR$(X+3)+CHR$(Y+3)+T$(2);
1940 PRINT P$;
1950 FOR M = 4  TO 7
1960 PRINT Y$;CHR$(X+3)+CHR$(Y+M)+T$(0);
1970 NEXT M
1980 PRINT Q$;
1990 PRINT Y$;CHR$(X+3)+CHR$(Y+8)+T$(1);
2000 REM PRINT LINE #5
2010 PRINT Y$;CHR$(X+4)+CHR$(Y+4)+T$(2);
2020 PRINT P$;
2030 PRINT Y$;CHR$(X+4)+CHR$(Y+5)+T$(0);
2040 PRINT Y$;CHR$(X+4)+CHR$(Y+6)+T$(0);
2050 PRINT Q$;
2060 PRINT Y$;CHR$(X+4)+CHR$(Y+7)+T$(1);
2070 REM PRINT LINE #6
2080 PRINT Y$;CHR$(X+5)+CHR$(Y+5)+T$(2);
2090 PRINT Y$;CHR$(X+5)+CHR$(Y+6)+T$(1);
2100 PRINT P$;
2110 RETURN
2120 REM **DIAMOND**
2130 REM PRINT LINE #1
2140 PRINT Y$;CHR$(X)+CHR$(Y+5)+T$(1);
2150 PRINT Y$;CHR$(X)+CHR$(Y+6)+T$(2);
2160 REM PRINT LINE #2
2170 PRINT Y$;CHR$(X+1)+CHR$(Y+4)+T$(1);
2180 PRINT Y$;CHR$(X+1)+CHR$(Y+5)+T$(0);
2190 PRINT Y$;CHR$(X+1)+CHR$(Y+6)+T$(0);
2200 PRINT Y$;CHR$(X+1)+CHR$(Y+7)+T$(2);
2210 REM PRINT LINE #3
2220 PRINT Y$;CHR$(X+2)+CHR$(Y+3)+T$(1);
2230 FOR M = 4  TO 7
2240 PRINT Y$;CHR$(X+2)+CHR$(Y+M)+T$(0);
2250 NEXT M
2260 PRINT Y$;CHR$(X+2)+CHR$(Y+8)+T$(2);
2270 REM PRINT LINE #4
2280 PRINT Q$;
2290 PRINT Y$;CHR$(X+3)+CHR$(Y+3)+T$(2);
2300 PRINT P$;
2310 FOR M =4  TO 7
2320 PRINT Y$;CHR$(X+3)+CHR$(Y+M)+T$(0);
2330 NEXT M
2340 PRINT Q$;
2350 PRINT Y$;CHR$(X+3)+CHR$(Y+8)+T$(1);
2360 REM PRINT LINE #5
2370 PRINT Y$;CHR$(X+4)+CHR$(Y+4)+T$(2);
2380 PRINT P$;
2390 PRINT Y$;CHR$(X+4)+CHR$(Y+5)+T$(0);
2400 PRINT Y$;CHR$(X+4)+CHR$(Y+6)+T$(0);
2410 PRINT Q$;
2420 PRINT Y$;CHR$(X+4)+CHR$(Y+7)+T$(1);
2430 REM PRINT LINE #6
2440 PRINT Y$;CHR$(X+5)+CHR$(Y+5)+T$(2);
2450 PRINT Y$;CHR$(X+5)+CHR$(Y+6)+T$(1);
2460 PRINT P$;
2470 RETURN
2480 REM **CLUB**
2490 REM PRINT LINE #1
2500 PRINT Y$;CHR$(X)+CHR$(Y+4)+T$(1);
2510 PRINT Y$;CHR$(X)+CHR$(Y+5)+T$(0);
2520 PRINT Y$;CHR$(X)+CHR$(Y+6)+T$(0);
2530 PRINT Y$;CHR$(X)+CHR$(Y+7)+T$(2);
2540 REM PRINT LINE #2
2550 PRINT Q$;
2560 PRINT Y$;CHR$(X+1)+CHR$(Y+4)+T$(2);
2570 PRINT P$;
2580 PRINT Y$;CHR$(X+1)+CHR$(Y+5)+T$(0);
2590 PRINT Y$;CHR$(X+1)+CHR$(Y+6)+T$(0);
2600 PRINT Q$;
2610 PRINT Y$;CHR$(X+1)+CHR$(Y+7)+T$(1);
2620 PRINT P$;
2630 REM PRINT LINE #3
2640 PRINT Y$;CHR$(X+2)+CHR$(Y+2)+T$(1);
2650 FOR M = 3  TO 8
2660 PRINT Y$;CHR$(X+2)+CHR$(Y+M)+T$(0);
2670 NEXT M
2680 PRINT Y$;CHR$(X+2)+CHR$(Y+9)+T$(2);
2690 REM PRINT LINE #4
2700 PRINT Q$;
2710 PRINT Y$;CHR$(X+3)+CHR$(Y+2)+T$(2);
2720 PRINT P$;
2730 FOR M = 3  TO 8
2740 PRINT Y$;CHR$(X+3)+CHR$(Y+M)+T$(0);
2750 NEXT M
2760 PRINT Q$;
2770 PRINT Y$;CHR$(X+3)+CHR$(Y+9)+T$(1);
2780 PRINT P$;
2790 REM PRINT LINE #5
2800 PRINT Y$;CHR$(X+4)+CHR$(Y+5)+T$(0);
2810 PRINT Y$;CHR$(X+4)+CHR$(Y+6)+T$(0);
2820 REM PRINT LINE #6
2830 PRINT Y$;CHR$(X+5)+CHR$(Y+5)+T$(0);
2840 PRINT Y$;CHR$(X+5)+CHR$(Y+6)+T$(0);
2850 RETURN
2860 REM **SPADE**
2870 REM PRINT LINE #1
2880 PRINT Y$;CHR$(X)+CHR$(Y+5)+T$(1);
2890 PRINT Y$;CHR$(X)+CHR$(Y+6)+T$(2);
2900 REM PRINT LINE #2
2910 PRINT Y$;CHR$(X+1)+CHR$(Y+4)+T$(1);
2920 PRINT Y$;CHR$(X+1)+CHR$(Y+5)+T$(0);
2930 PRINT Y$;CHR$(X+1)+CHR$(Y+6)+T$(0);
2940 PRINT Y$;CHR$(X+1)+CHR$(Y+7)+T$(2);
2950 REM PRINT LINE #3
2960 PRINT Y$;CHR$(X+2)+CHR$(Y+3)+T$(1);
2970 FOR M = 4  TO 7
2980 PRINT Y$;CHR$(X+2)+CHR$(Y+M)+T$(0);
2990 NEXT M
3000 PRINT Y$;CHR$(X+2)+CHR$(Y+8)+T$(2);
3010 REM PRINT LINE #4
3020 PRINT Q$;
3030 PRINT Y$;CHR$(X+3)+CHR$(Y+3)+T$(2);
3040 PRINT P$;
3050 FOR M = 4  TO 7
3060 PRINT Y$;CHR$(X+3)+CHR$(Y+M)+T$(0);
3070 NEXT M
3080 PRINT Q$;
3090 PRINT Y$;CHR$(X+3)+CHR$(Y+8)+T$(1);
3100 PRINT P$;
3110 REM PRINT LINE #5
3120 PRINT Y$;CHR$(X+4)+CHR$(Y+5)+T$(0);
3130 PRINT Y$;CHR$(X+4)+CHR$(Y+6)+T$(0);
3140 REM PRINT LINE #6
3150 PRINT Q$;
3160 PRINT Y$;CHR$(X+5)+CHR$(Y+5)+T$(3);
3170 PRINT Y$;CHR$(X+5)+CHR$(Y+6)+T$(3);
3180 PRINT P$;
3190 RETURN
3200 REM **ACE**
3210 AC=1
3220 REM PRINT LINE #1
3230 L=X
3240 GOSUB 5520
3250 REM PRINT LINE #2
3260 L=X+1
3270 GOSUB 5570
3280 REM PRINT LINE #3
3290 L=X+2
3300 GOSUB 5520
3310 REM PRINT LINE #4
3320 L=X+3
3330 GOSUB 5570
3340 REM PRINT LINE #5
3350 L=X+4
3360 GOSUB 5570
3370 RETURN
3380 REM **TWO**
3390 REM PRINT LINE #1
3400 L=X
3410 GOSUB 5520
3420 REM PRINT LINE #2
3430 L=X+1
3440 GOSUB 5620
3450 REM PRINT LINE #3
3460 L=X+2
3470 GOSUB 5520
3480 REM PRINT LINE #4
3490 L=X+3
3500 GOSUB 5710
3510 REM PRINT LINE #5
3520 L=X+4
3530 GOSUB 5520
3540 RETURN
3550 REM **THREE**
3560 REM PRINT LINE #1
3570 L=X
3580 GOSUB 5520
3590 REM PRINT LINE #2
3600 L=X+1
3610 GOSUB 5610
3620 REM PRINT LINE #3
3630 PRINT Y$;CHR$(X+2)+CHR$(Y+2)+T$(0);
3640 PRINT Y$;CHR$(X+2)+CHR$(Y+3)+T$(0);
3650 PRINT Y$;CHR$(X+2)+CHR$(Y+4)+T$(0);
3660 REM PRINT LINE #4
3670 L=X+3
3680 GOSUB 5610
3690 REM PRINT LINE #5
3700 L=X+4
3710 GOSUB 5520
3720 RETURN
3730 REM **FOUR**
3740 REM PRINT LINE #1
3750 L=X
3760 GOSUB 5640
3770 REM PRINT LINE #2
3780 L=X+1
3790 GOSUB 5640
3800 REM PRINT LINE #3
3810 L=X+2
3820 GOSUB 5520
3830 REM PRINT LINE #4
3840 L=X+3
3850 GOSUB 5680
3860 REM PRINT LINE #5
3870 L=X+4
3880 GOSUB 5680
3890 RETURN
3900 REM **FIVE**
3910 REM PRINT LINE #1
3920 L=X
3930 GOSUB 5520
3940 REM PRINT LINE #2
3950 L=X+1
3960 GOSUB 5710
3970 REM PRINT LINE #3
3980 L=X+2
3990 GOSUB 5520
4000 REM PRINT LINE #4
4010 L=X+3
4020 GOSUB 5610
4030 REM PRINT LINE #5
4040 L=X+4
4050 GOSUB 5520
4060 RETURN
4070 REM **SIX**
4080 REM PRINT LINE #1
4090 L=X
4100 GOSUB 5710
4110 REM PRINT LINE #2
4120 L=X+1
4130 GOSUB 5710
4140 REM PRINT LINE #3
4150 L=X+2
4160 GOSUB 5520
4170 REM PRINT LINE #4
4180 L=X+3
4190 GOSUB 5570
4200 REM PRINT LINE #5
4210 L=X+4
4220 GOSUB 5520
4230 RETURN
4240 REM **SEVEN**
4250 REM PRINT LINE #1
4260 L=X
4270 GOSUB 5520
4280 REM PRINT LINE #2
4290 L=X+1
4300 GOSUB 5570
4310 REM PRINT LINE #3
4320 L=X+2
4330 GOSUB 5610
4340 REM PRINT LINE #4
4350 L=X+3
4360 GOSUB 5610
4370 REM PRINT LINE #5
4380 L=X+4
4390 GOSUB 5610
4400 RETURN
4410 REM **EIGHT**
4420 REM PRINT LINE #1
4430 L=X
4440 GOSUB 5520
4450 REM PRINT LINE #2
4460 L=X+1
4470 GOSUB 5570
4480 REM PRINT LINE #3
4490 L=X+2
4500 GOSUB 5520
4510 REM PRINT LINE #4
4520 L=X+3
4530 GOSUB 5570
4540 REM PRINT LINE #5
4550 L=X+4
4560 GOSUB 5520
4570 RETURN
4580 REM **NINE**
4590 REM PRINT LINE #1
4600 L=X
4610 GOSUB 5520
4620 REM PRINT LINE #2
4630 L=X+1
4640 GOSUB 5570
4650 REM PRINT LINE #3
4660 L=X+2
4670 GOSUB 5520
4680 REM PRINT LINE #4
4690 L=X+3
4700 GOSUB 5610
4710 REM PRINT LINE #5
4720 L=X+4
4730 GOSUB 5610
4740 RETURN
4750 REM **TEN**
4760 REM PRINT LINE #1
4770 L=X
4780 GOSUB 5740
4790 REM PRINT LINE #2
4800 L=X+1
4810 GOSUB 5800
4820 REM PRINT LINE #3
4830 L=X+2
4840 GOSUB 5800
4850 REM PRINT LINE #4
4860 L=X+3
4870 GOSUB 5800
4880 REM PRINT LINE #5
4890 L=X+4
4900 GOSUB 5740
4910 RETURN
4920 REM **JACK**
4930 REM PRINT LINE #1
4940 L=X
4950 GOSUB 5520
4960 REM PRINT LINE #2
4970 PRINT Y$;CHR$(X+1)+CHR$(Y+2)+T$(0);
4980 REM PRINT LINE #3
4990 PRINT Y$;CHR$(X+2)+CHR$(Y+2)+T$(0);
5000 REM PRINT LINE #4
5010 PRINT Y$;CHR$(X+3)+CHR$(Y)+T$(0);
5020 PRINT Y$;CHR$(X+3)+CHR$(Y+2)+T$(0);
5030 REM PRINT LINE #5
5040 L=X+4
5050 GOSUB 5850
5060 RETURN
5070 REM **QUEEN**
5080 REM PRINT LINE #1
5090 L=X
5100 GOSUB 5520
5110 REM PRINT LINE #2
5120 L=X+1
5130 GOSUB 5570
5140 REM PRINT LINE #3
5150 PRINT Y$;CHR$(X+2)+CHR$(Y)+T$(0);
5160 PRINT Y$;CHR$(X+2)+CHR$(Y+2)+T$(0);
5170 PRINT Y$;CHR$(X+2)+CHR$(Y+4)+T$(0);
5180 REM PRINT LINE #4
5190 PRINT Y$;CHR$(X+3)+CHR$(Y)+T$(0);
5200 PRINT Y$;CHR$(X+3)+CHR$(Y+3)+T$(0);
5210 PRINT Y$;CHR$(X+3)+CHR$(Y+4)+T$(0);
5220 REM PRINT LINE #5
5230 L=X+4
5240 GOSUB 5520
5250 RETURN
5260 REM **KING**
5270 REM PRINT LINE #1
5280 L=X
5290 GOSUB 5570
5300 REM PRINT LINE #2
5310 L=X+1
5320 GOSUB 5640
5330 REM PRINT LINE #3
5340 L=X+2
5350 GOSUB 5850
5360 REM PRINT LINE #4
5370 L=X+3
5380 GOSUB 5640
5390 REM PRINT LINE #5
5400 L=X+4
5410 GOSUB 5570
5420 RETURN
5430 REM CLEAR AREA
5440 PRINT Q$;
5450 FOR K = 0  TO R
5460 FOR L = 0  TO P
5470 PRINT Y$;CHR$(X+K)+CHR$(Y+L)+T$(0);
5480 NEXT L
5490 NEXT K
5500 PRINT P$;
5510 RETURN
5520 REM PRINT 5 COL. ACROSS
5530 FOR M = 0  TO 4
5540 PRINT Y$;CHR$(L)+CHR$(Y+M)+T$(0);
5550 NEXT M
5560 RETURN
5570 REM PRINT COL. 1 & 5
5580 PRINT Y$;CHR$(L)+CHR$(Y)+T$(0);
5590 PRINT Y$;CHR$(L)+CHR$(Y+4)+T$(0);
5600 RETURN
5610 REM PRINT COL. 5
5620 PRINT Y$;CHR$(L)+CHR$(Y+4)+T$(0);
5630 RETURN
5640 REM PRINT COL. 1 & 4
5650 PRINT Y$;CHR$(L)+CHR$(Y)+T$(0);
5660 PRINT Y$;CHR$(L)+CHR$(Y+3)+T$(0);
5670 RETURN
5680 REM PRINT LINE COL. 4
5690 PRINT Y$;CHR$(L)+CHR$(Y+3)+T$(0);
5700 RETURN
5710 REM PRINT COL. 1
5720 PRINT Y$;CHR$(L)+CHR$(Y)+T$(0);
5730 RETURN
5740 REM PRINT COL. 1,3,4,& 5
5750 PRINT Y$;CHR$(L)+CHR$(Y)+T$(0);
5760 PRINT Y$;CHR$(L)+CHR$(Y+2)+T$(0);
5770 PRINT Y$;CHR$(L)+CHR$(Y+3)+T$(0);
5780 PRINT Y$;CHR$(L)+CHR$(Y+4)+T$(0);
5790 RETURN
5800 REM PRINT COL. 1,3,& 5
5810 PRINT Y$;CHR$(L)+CHR$(Y)+T$(0);
5820 PRINT Y$;CHR$(L)+CHR$(Y+2)+T$(0);
5830 PRINT Y$;CHR$(L)+CHR$(Y+4)+T$(0);
5840 RETURN
5850 REM PRINT COL. 1,2,& 3
5860 PRINT Y$;CHR$(L)+CHR$(Y)+T$(0);
5870 PRINT Y$;CHR$(L)+CHR$(Y+1)+T$(0);
5880 PRINT Y$;CHR$(L)+CHR$(Y+2)+T$(0);
5890 RETURN
5900 REM REACHED LIMIT OF 25000
5910 IF MO > 0  THEN  PRINT NA$;", YOU HAVE WON ";:PRINT  USING "$$##,###";MO;
:PRINT ". VERY GOOD."
5920 IF MO < 0  THEN  PRINT NA$;", YOU HAVE LOST ";:PRINT  USING "$$##,###";MO;
:PRINT ". TOO BAD."
5930 REM END OF PROGRAM
5940 PRINT Q$;G$;Y5$;Y3$
5950 QA$=""
5960 INPUT "DO YOU WANT TO PLAY AGAIN. Y OR N. ";QA$
5970 IF QA$ = "Y"  THEN 230
5980 END
5990 REM SHUFFLE CARDS
6000 C1=52:A=0
6010 K=INT(C1*RND(1)):C=D(K)
6020 IF K=51  THEN 6040
6030 FOR I= K  TO 50:D(I)=D(I+1):NEXT I
6040 D(51)=C:C1=C1-1
6050 IF C1=0  THEN 6070
6060 GOTO 6010
6070 RETURN
6080 REM TRANSFORM INTO RANKS
6090 IF D(A) < 13  THEN N=D(A)+1:RETURN
6100 IF D(A) < 26  THEN N=D(A)-12:RETURN
6110 IF D(A) < 39  THEN N=D(A)-25:RETURN
6120 N=D(A)-38:RETURN
6130 REM TRANSFORM INTO SUITS
6140 S=INT(D(A)/13)+1
6150 A=A+1:RETURN
6160 REM PRINT 'RESHUFFLE' MESSAGE
6170 GOSUB 6420:PRINT "CARDS ARE BEING RESHUFFLED.":PRINT F$;P$;X5$;
6180 GOSUB 5990:RETURN
6190 REM  PRINT INSTRUCTIOS
6200 PRINT "THIS GAME IS A VARIATION OF 'RED DOG'. IT IS ALSO KNOWN AS"
6210 PRINT "ACEY-DEUCEY."
6220 PRINT "YOU ARE DEALT TWO CARDS. YOU THEN DECIDE IF YOU WANT TO BET"
6230 PRINT "THAT THE NEXT CARD DEALT WILL BE HIGHER THAN ONE CARD AND"
6240 PRINT "LOWER THEN THE OTHER. i.e. FALL IN BETWEEN THE TWO CARDS SHOWN."
6250 PRINT "IF THE NEXT CARD FALLS IN BETWEEN, YOU WIN WHAT YOU BET OTHERWISE"
6260 PRINT "YOU LOSE."
6270 PRINT "GAME WILL END WHEN YOU HAVE EITHER WON OR LOSE $25,000"
6280 PRINT
6290 PRINT "*********************IMPORTANT**************************"
6300 PRINT "IF ONE OF THE CARDS IS AN 'ACE', YOU MUST DECLARE WHETHER THE"
6310 PRINT "'ACE' IS HIGH OR LOW. YOU DO THIS BY ANSWERING THE QUESTION"
6320 PRINT "'ENTER BET' WITH HXXX OR LXXX WHERE XXX IS THE NUMBER YOU WANT"
6330 PRINT "TO BET. IF YOU FORGET TO DECLARE YOU 'ACE' YOU AUTOMATICALLY LOSE."
6340 PRINT
6350 PRINT "IF YOU DON'T WANT TO PLAY WITH THE TWO CARDS DEALT, ENTER '0' FOR"
6360 PRINT "BET AND TWO NEW CARDS WILL BE DEALT."
6370 PRINT "IF YOU WANT TO QUIT, ENTER 'QUIT' FOR BET."
6380 PRINT "WHEN THE CARDS HAVE BEEN EXHAUSTED, THE CARDS WILL BE RESHUFFLED"
6390 PRINT "AND PLAY WILL CONTINUE."
6400 PRINT "HIT RETURN WHEN READY TO BEGIN."
6410 RETURN
6420 PRINT Q$;G$;
6430 FOR I = 52  TO 55
6440 PRINT Y$;CHR$(I)+CHR$(32)+EL$;
6450 NEXT I
6460 PRINT Y$;CHR$(52)+CHR$(32);Y5$;
6470 RETURN
6480 PRINT F$;P$;X5$;
6490 RETURN
6500 REM  PRINT AMOUNT YOU HAVE
6510 PRINT Q$;G$;Y$;CHR$(32)+CHR$(32)+EL$;
6520 PRINT NA$;", YOU HAVE ";
6530 PRINT  USING "$$##,###";MO
6540 PRINT F$;P$;
6550 RETURN
