Compucolor.org – Virtual Media

Listing of file='UNO.BAS;01' on disk='vmedia/chip_12-sector.ccvf'

0 PLOT 6,2,12,27,24,15
5 CLEAR 750
10 OUT 8,255:OUT 8,247
20 DIM DK(108),KD(108)
22 DIM CP(2,20)
23 DIM YC(20)
40 BL$= "                                                              "
90 GOTO 500
100 PLOT 14,6,6,3,0,31,11:RETURN
110 FOR S1= 0TO 650:NEXT S1:RETURN
120 IF D2> 100THEN D3= 0:GOTO 129
122 D3= 1:FOR D4= 1TO 4
124 IF D2> 25THEN D2= D2- 25:D3= D3+ 1
125 NEXT D4
126 IF D2> 19THEN 129
127 IF D2> 10THEN D2= D2- 10
128 IF D2= 10THEN D2= 0
129 RETURN
140 IF DN= 0THEN TP= 1:NP= 2:GOTO 220
142 TP= 2:NP= 1:GOTO 220
150 PLOT 14,6,6,3,35,7:PRINT RIGHT$ ((STR$ (DC)),2):RETURN
160 PLOT 14,6,6,3,27,7:PRINT RIGHT$ ((STR$ (SK)),2):RETURN
170 IF DN= 0THEN TP= 2:NP= 0:GOTO 220
172 TP= 1:NP= 0:GOTO 220
180 IF DN= 0THEN DN= 1:TP= 2:NP= 1:GOTO 220
182 DN= 0:TP= 1:NP= 2:GOTO 220
190 PLOT 6,2,15:FOR Y= 9TO 15:PLOT 3,26,Y:PRINT "     ":NEXT Y:RETURN
200 FOR I= 1TO SK:DK(I)= DK(I+ 1):NEXT I:DK(SK+ 1)= 0:RETURN
210 FOR AA= 2TO DC:KD(AA)= KD(AA- 1):NEXT AA:RETURN
220 PLOT 15,6,7,3,29,17:IF DN= 0THEN PRINT "<a=====":RETURN
222 PRINT "=====b>":RETURN
500 REM  THIS AND THAT
510 GOSUB 1000
520 A= PEEK (33209):FOR B= 0TO 5* A:C= RND (1):NEXT B
525 X= INT (108* RND (1)+ 1)
530 GOSUB 100
540 PRINT "HIT RETURN TO SHUFFLE CARDS."
545 OUT 8,255
550 POKE 33278,0
560 A= RND (1)
570 IF PEEK (33278)= 0THEN 560
580 OUT 8,247
590 GOSUB 100
600 GOSUB 42000
602 PLOT 6,2,14,3,1,29:PRINT BL$
604 PLOT 6,4,2,0,8,242,127,8,255
610 FOR A= 1TO 7:CP(1,A)= DK(A+ 8):NEXT A
620 FOR A= 1TO 7:CP(2,A)= DK(A+ 15):NEXT A
630 FOR A= 1TO 7:YC(A)= DK(A):NEXT A
640 FOR A= 1TO 108:KD(A)= 0:NEXT A:KD(1)= DK(22)
650 FOR A= 1TO 86:DK(A)= DK(A+ 22):NEXT A
660 FOR A= 87TO 108:DK(A)= 0:NEXT A
670 DC= 1:YD= 7:PC(1)= 7:PC(2)= 7:SK= 86
680 X= KD(1):X9= 33:Y9= 9:GOSUB 40000
685 CO= X2
686 GOSUB 5000
687 X9= 26:Y9= 9:GOSUB 40970
688 Y9= 3:X9= 12:GOSUB 40970:X9= 47:GOSUB 40970
690 GOSUB 12000
700 GOSUB 11000
710 DF= 0:NP= 1:TP= 0
720 PLOT 14,6,6,3,14,11:PRINT "7"
730 PLOT 3,49,11:PRINT "7"
740 PLOT 14,6,6,3,27,7:PRINT "86      1"
750 GOSUB 100
760 OUT 8,255
770 INPUT "AUDIT PLAYERS #1 & #2 (Y/N) ? ";Q$
775 GOSUB 100
780 OUT 8,247
790 IF LEFT$ (Q$,1)< > "Y"THEN T3= 0:GOTO 800
795 T3= 1
800 REM
900 GOTO 2000
1000 REM  HOUSEKEEPING
1005 T3= 1
1010 PLOT 6,4
1020 PLOT 2,0,8,242,0,127,127,127,127,8,0,8,255
1030 PLOT 14,6,1,3,27,1
1040 PRINT "  U N O  "
1080 PLOT 6,7,15
1082 PLOT 27,10,3,24,10
1084 PRINT "STOCK"
1085 PLOT 3,39,9:PRINT "DISCARD"
1086 PLOT 27,24
1110 PLOT 6,1,15
1120 PLOT 2,20,60,242,63,119,107,60,20,60,255
1130 PLOT 27,10,15,6,7
1140 PLOT 3,10,3:PRINT "PLAYER"
1150 PLOT 3,45,3:PRINT "PLAYER"
1155 PLOT 27,24
1160 PLOT 14,6,3,3,18,5
1170 PRINT "# 1"
1180 PLOT 3,53,5:PRINT "# 2"
1250 PLOT 15,6,7,3,29,17
1260 PRINT "<a====="
1290 PLOT 15,6,4
1300 PLOT 3,1,1:PRINT "  "
1310 PLOT 3,1,2:PRINT "b   a"
1320 PLOT 3,1,3:PRINT " eee "
1330 PLOT 3,1,4:PRINT "SCORE"
1340 PLOT 3,58,1:PRINT "  "
1350 PLOT 3,58,2:PRINT "b   a"
1360 PLOT 3,58,3:PRINT " eee "
1370 PLOT 3,58,4:PRINT "SCORE"
1380 PLOT 3,1,15:PRINT "  "
1390 PLOT 3,1,16:PRINT "b   a"
1400 PLOT 3,1,17:PRINT " eee "
1410 PLOT 3,1,13:PRINT "YOUR"
1420 PLOT 3,1,14:PRINT "SCORE"
1430 GOSUB 4110
1440 GOSUB 6100
1999 RETURN
2000 REM  MAIN ROUTINE
2005 GOSUB 5500
2010 D2= KD(1):GOSUB 120
2015 IF D2< 20THEN 2100
2020 IF D2< 26THEN 2050
2025 IF KD(1)> 104THEN GOSUB 2060:GOTO 2040
2030 GOTO 2100
2040 GOSUB 3010:GOSUB 3010
2042 GOSUB 3010:T6= 0:GOSUB 3010
2044 GOSUB 140
2045 GOSUB 2090
2046 GOTO 6000
2050 IF D2< 22THEN GOSUB 2060:GOTO 2042
2052 IF D2< 24THEN GOSUB 2090:GOTO 2100
2054 GOTO 2044
2060 REM
2065 OUT 8,255:GOSUB 100
2070 INPUT "HIT RETURN TO DRAW CARDS FROM STOCK";Q$
2072 OUT 8,247
2075 GOSUB 100
2076 T6= 1
2080 RETURN
2090 D2= KD(1):GOSUB 120
2092 IF D2> 23THEN KD(1)= 104:GOTO 2098
2094 IF D2> 21THEN KD(1)= 103:GOTO 2098
2096 IF D2> 19THEN KD(1)= 102:GOTO 2098
2097 KD(1)= 101
2098 RETURN
2100 GOSUB 100
2120 OUT 8,255
2130 PRINT "PLAY CARD (A-";CHR$ (YD+ 64);")  OR  HIT RETURN TO GET CARD FROM STOCK ";
2140 INPUT "";Q$
2150 Q$= LEFT$ (Q$,1)
2152 GOSUB 100:OUT 8,247
2160 IF Q$= "0"OR Q$= ""THEN 3000
2170 IF Q$> "@"AND Q$< "U"THEN 2300
2175 IF Q$= "Z"AND 9000
2180 PRINT "DISCARD NOT A-T"
2190 GOSUB 110
2200 GOSUB 100
2210 GOTO 2000
2220 PRINT "DISCARD LETTER EMPTY"
2230 GOTO 2190
2300 D1= ASC (Q$)- 64
2310 IF D1> YDTHEN 2220
2320 D2= YC(D1)
2325 D5= D2
2330 GOSUB 120
2335 D6= D2:D7= D3
2340 IF D2> 104THEN 2800
2350 IF D2> 100THEN 2750
2355 IF CO< > D3THEN 2550
2360 IF D2> 23THEN 2700
2370 IF D2> 21THEN 2650
2380 IF D2> 19THEN 2600
2390 GOSUB 140
2400 GOTO 2830
2550 IF KD(1)= 101THEN 2900
2560 D2= KD(1):D5= D2
2570 GOSUB 120
2575 IF D2= D6THEN 2600
2576 IF D6> 23AND D2= 104THEN 2590
2577 IF D2= 103THEN 2586
2578 IF D2= 102THEN 2620
2580 PRINT "NEITHER COLOR NOR VALUE MATCH"
2585 GOTO 2190
2586 IF D6= 22OR D6= 23THEN 2590
2587 GOTO 2580
2590 CO= D7:GOSUB 5000
2595 IF D2= 103THEN 2650
2596 IF D2= 104THEN 2700
2600 GOSUB 140
2610 GOTO 2830
2620 IF D6= 20OR D6= 21THEN 2590
2625 GOTO 2580
2650 GOSUB 180
2660 GOTO 2830
2700 GOSUB 170
2710 GOTO 2830
2750 GOSUB 2821:GOTO 2830
2760 GOSUB 100:PRINT "COLOR CHOSEN NOT YELLOW, BLUE, RED OR GREEN"
2770 GOSUB 110:GOTO 2821
2800 FOR A= 1TO YD
2810 IF YC(A)> (25* CO- 24)- 1AND YC(A)< (25* CO)+ 1THEN 2880
2815 NEXT A
2820 GOSUB 2821:GOTO 2830
2821 GOSUB 100:OUT 8,255
2822 INPUT "SELECT COLOR:  YELLOW (Y),  BLUE (B),  RED (R),  GREEN (G) ";Q$
2823 OUT 8,247:Q$= LEFT$ (Q$,1):IF Q$= "Y"THEN CO= 1:GOTO 2829
2824 IF Q$= "B"THEN CO= 2:GOTO 2829
2825 IF Q$= "R"THEN CO= 3:GOTO 2829
2826 IF Q$= "G"THEN CO= 4:GOTO 2829
2827 GOTO 2760
2829 GOSUB 100:X2= CO:GOSUB 5000:RETURN
2830 IF T5= 0THEN 2838
2831 OUT 8,255:T5= 0
2832 GOSUB 100:INPUT "CARD FROM STOCK PLAYABLE...HIT RETURN.  ENTER N TO PASS. ";Q$
2833 GOSUB 100:OUT 8,247
2834 IF LEFT$ (Q$,1)= "0"OR LEFT$ (Q$,1)= ""THEN 2838
2835 GOSUB 140:GOTO 6000
2838 GOSUB 140
2839 GOSUB 11010
2840 X= YC(D1):X9= 33:Y9= 9:GOSUB 40000
2842 CO= X2
2845 GOSUB 210:KD(1)= X
2850 YC(D1)= 0:YD= YD- 1
2860 GOSUB 12000:GOSUB 11020
2862 IF YD= 1THEN GOSUB 100:PLOT 6,1,31:PRINT " U N O     !!!":GOSUB 110:GOSUB 100
2872 DC= DC+ 1:GOSUB 150
2874 IF YD< 1THEN TP= 0:GOTO 4000
2878 GOTO 6000
2880 PRINT "DISCARD OF DRAW 4 NOT ALLOWED. YOU CAN FOLLOW COLOR."
2890 GOTO 2190
2900 PRINT "COLOR OF YOUR DISCARD DOES NOT MATCH PRESENT COLOR"
2910 GOTO 2190
3000 REM
3002 T5= 1
3005 GOSUB 3010:GOTO 3130
3010 IF SK< 1THEN 3900
3020 GOSUB 190
3030 D5= DK(1):D2= D5
3035 GOSUB 120
3040 GOSUB 200
3045 SK= SK- 1:GOSUB 160
3055 X9= 26:Y9= 9:GOSUB 40970
3060 YD= YD+ 1
3065 IF YD> 20THEN 9000
3070 FOR A= 1TO 20
3080 IF YC(A)= 0THEN YC(A)= D5:D1= A:GOTO 3095
3090 NEXT A
3095 IF T6= 1THEN 3110
3100 GOSUB 12000:GOSUB 11000
3110 RETURN
3130 IF D5= 101THEN 3500
3140 IF D3= COTHEN 3600
3150 D6= D2:D7= D3
3160 D2= KD(1):D5= D2:GOSUB 120
3162 IF D6= D2THEN 3700
3163 IF D6> 23AND D2= 104THEN 3200
3164 IF D2= 103THEN 3300
3165 IF D2= 102THEN 3400
3171 T5= 0
3172 GOSUB 100:PRINT "NO PLAY ON CARD FROM STOCK"
3173 FOR AA= 0TO 300:NEXT AA:GOSUB 100
3175 GOSUB 140
3180 GOTO 6000
3200 GOTO 2590
3300 IF D6= 22OR D6= 23THEN 2590
3310 GOTO 3171
3400 IF D6= 20OR D6= 21THEN 2590
3410 GOTO 3171
3500 OUT 8,255:GOSUB 100
3502 INPUT "CARD FROM STOCK PLAYABLE...HIT RETURN.  ENTER N TO PASS. ";Q$
3504 GOSUB 100:OUT 8,247
3506 IF LEFT$ (Q$,1)= "0"OR LEFT$ (Q$,1)= ""THEN T5= 0:GOSUB 2821:GOTO 2838
3508 GOTO 2835
3510 GOTO 2830
3600 GOTO 2360
3700 GOTO 2600
3900 GOSUB 100:PRINT "STOCK EMPTY.":GOSUB 110
3910 GOTO 9000
4000 REM
4010 GOSUB 100
4015 PLOT 6,15+ 64,11
4020 PRINT "YOU WIN !!"
4030 GOSUB 110:GOSUB 110
4040 REM
4100 PS(TP)= PS(TP)+ 1
4105 GOSUB 4110
4106 GOTO 9000
4110 PLOT 15,6,7
4120 PLOT 3,2,16
4130 PRINT RIGHT$ ((STR$ (PS(0))),3)
4140 PLOT 3,2,2
4150 PRINT RIGHT$ ((STR$ (PS(1))),3)
4160 PLOT 3,59,2
4170 PRINT RIGHT$ ((STR$ (PS(2))),3)
4200 RETURN
5000 PLOT 14,3,56,17
5010 IF CO= 1THEN PLOT 6,3:PRINT "YELLOW"
5020 IF CO= 2THEN PLOT 6,4:PRINT " BLUE "
5030 IF CO= 3THEN PLOT 6,1:PRINT " RED  "
5040 IF CO= 4THEN PLOT 6,2:PRINT " GREEN"
5050 RETURN
5500 IF T3= 0THEN RETURN
5505 PLOT 15,3,0,28,11,6,3:PRINT "# 1 ";
5506 PLOT 6,7
5510 FOR AA= 1TO PC(1)
5520 IF CP(1,AA)< > 0THEN GOSUB 5700
5522 NEXT AA
5524 GOTO 5540
5530 PLOT 6,7:RETURN
5535 NEXT AA
5540 PRINT
5545 PLOT 3,0,29,11,6,3:PRINT "# 2 ";
5546 PLOT 6,7
5550 FOR AA= 1TO PC(2)
5560 IF CP(2,AA)< > 0THEN 5800
5570 NEXT AA
5572 PLOT 6,2,15,3,26,8:PRINT "      "
5573 PLOT 6,7,3,26,8:D2= DK(1)
5574 IF D2> 104THEN PRINT "DRAW4":GOTO 5580
5575 IF D2> 100THEN PRINT "WILD ":GOTO 5580
5576 GOSUB 120:GOSUB 5715
5580 PRINT
5590 RETURN
5700 IF CP(1,AA)> 104THEN PRINT " DRAW4";:GOTO 5530
5705 IF CP(1,AA)> 100THEN PRINT " WILD";:GOTO 5530
5710 D2= CP(1,AA):GOSUB 120
5715 IF D3= 1THEN PLOT 6,3
5720 IF D3= 2THEN PLOT 6,4
5725 IF D3= 3THEN PLOT 6,1
5730 IF D3= 4THEN PLOT 6,2
5735 IF D2> 23THEN PRINT " SKIP";:GOTO 5530
5740 IF D2> 21THEN PRINT " REV";:GOTO 5530
5745 IF D2> 19THEN PRINT " DRAW2";:GOTO 5530
5750 PRINT D2;:GOTO 5530
5800 IF CP(2,AA)> 104THEN PRINT " DRAW4";:GOTO 5900
5810 IF CP(2,AA)> 100THEN PRINT " WILD";:GOTO 5900
5820 D2= CP(2,AA)
5830 GOSUB 120
5840 GOSUB 5715
5900 PLOT 6,7
5910 GOTO 5570
6000 REM  COMPUTER'S TURN
6010 GOTO 7000
6100 REM  PRINT INSTRUCTIONS
6110 PLOT 15,6,3
6120 PLOT 3,1,18
6130 PRINT "UNO COPYRIGHT INTERNATIONAL GAMES,INC. THE OBJECT OF THIS"
6140 PLOT 6,3,3,1,19
6150 PRINT "VERSION IS TO RID YOURSELF OF ALL YOUR CARDS BEFORE YOUR TWO"
6160 PLOT 3,1,20
6170 PRINT "OPPONENTS, PLAYERS #1 & #2. PLAYER TRYS TO PLAY ONE CARD FROM"
6180 PLOT 3,1,21
6190 PRINT "HIS HAND THAT EITHER MATCHES THE COLOR, NUMBER OR WORDING OF"
6200 PLOT 3,1,22
6210 PRINT "TOP CARD OF THE DISCARD PILE. IF YOU CAN'T MATCH, TRY TO PLAY"
6220 PLOT 3,1,23
6230 PRINT "A 'WILD' OR 'DRAW4' CARD, SELECTING NEXT COLOR. IF YOU HAVE"
6240 PLOT 3,1,24
6250 PRINT "NEITHER, YOU MUST DRAW THE TOP CARD FROM THE 'STOCK'...YOU"
6260 PLOT 3,1,25
6270 PRINT "CAN PLAY IT IMMEDIATELY, IF POSSIBLE, OR ADD IT TO YOURSPC( HAND."
6280 PLOT 3,1,26
6285 PLOT 6,1
6290 PRINT "WORD CARDS: 'SKIP' CAUSES NEXT PLAYER TO MISS HIS TURN,"
6300 PLOT 3,1,27
6310 PRINT "'REVERSE' CAUSES CHANGE IN DIRECTION OF PLAY, 'WILD' ALLOWS"
6320 PLOT 3,1,28
6330 PRINT "SELECTION OF NEW COLOR, 'DRAW2' AND DRAW4' FORCE NEXT PLAYER"
6340 PLOT 3,1,29
6350 PRINT "TO DRAW CARDS, & SELECT COLOR IF 'DRAW4'.        GOOD LUCK !"
6390 RETURN
7000 REM  CHECK FOR DRAW 4
7001 GOSUB 5000
7002 PLOT 14,6,67
7003 PLOT 3,18+ 35* (TP- 1),5
7004 PRINT "#";TP
7005 GOSUB 5500
7010 D2= KD(1):GOSUB 120
7020 IF KD(1)> 104THEN 8500
7030 IF KD(1)= 101THEN D7= CO:D6= 24:GOTO 7070
7035 IF KD(1)> 101THEN D7= CO:D6= KD(1):GOTO 7070
7040 IF D2> 23THEN KD(1)= 104:GOTO 8600
7050 IF D2> 21THEN KD(1)= 103:GOTO 7065
7060 IF D2> 19THEN KD(1)= 102:GOTO 8510
7065 D6= D2:D7= D3
7070 FOR A= 1TO PC(TP)
7080 IF CP(TP,A)< > 0THEN 7100
7090 NEXT A
7091 IF KD(1)= 101THEN 7155
7095 GOTO 7130
7100 IF CP(TP,A)> 100THEN 7120
7105 D2= CP(TP,A):GOSUB 120
7110 IF D3= D7THEN 7200
7120 GOTO 7090
7130 FOR A= 1TO PC(TP)
7140 IF CP(TP,A)< > 0THEN 7160
7150 NEXT A
7155 GOTO 7500:REM  CHECK FOR WILD OR DRAW 4
7160 IF CP(TP,A)> 100THEN 7180
7165 D2= CP(TP,A):GOSUB 120
7170 IF D2= D6THEN 7190
7172 IF D6= 104THEN 7182
7174 IF D6= 103THEN 7184
7176 IF D6= 102THEN 7186
7180 GOTO 7150
7182 IF D2= 24OR D2= 25THEN 7190
7183 GOTO 7180
7184 IF D2= 22OR D2= 23THEN 7190
7185 GOTO 7180
7186 IF D2= 20OR D2= 21THEN 7190
7187 GOTO 7180
7190 CO= D3:GOSUB 5000:GOTO 7200
7200 GOSUB 210
7210 KD(1)= CP(TP,A):CP(TP,A)= 0
7215 PC(TP)= PC(TP)- 1
7220 GOSUB 13000
7230 PLOT 14,6,6,3,14+ (TP- 1)* 35,11
7240 PRINT RIGHT$ ((STR$ (PC(TP))),2)
7250 X9= 12+ (TP- 1)* 35:Y9= 3:GOSUB 40970
7260 DC= DC+ 1:GOSUB 150
7270 X= KD(1):X9= 33:Y9= 9:GOSUB 40000
7280 IF D2= 22OR D2= 23THEN 7300
7290 GOTO 7320
7300 IF DN= 0THEN DN= 1:GOTO 7315
7310 DN= 0
7315 GOSUB 220
7320 IF PC(TP)= 1THEN 7400
7330 IF PC(TP)< 1THEN 7420
7340 GOTO 8600
7400 GOSUB 100:PLOT 6,1,31:PRINT " U N O    !!!":GOSUB 110:GOSUB 100
7410 GOTO 7340
7420 GOSUB 100
7425 PLOT 6,56+ 64,11
7430 PRINT "PLAYER #";TP;"  WINS   !!!"
7442 PLOT 6,1,15:FOR AA= 0TO 6:PLOT 3,12+ (TP- 1)* 35,3+ AA:PRINT "     ":NEXT AA
7445 GOSUB 110:GOSUB 110
7450 GOTO 4100
7500 FOR A= 1TO PC(TP)
7510 IF CP(TP,A)< > 0THEN 7800
7520 NEXT A
7530 REM  DRAW FROM STOCK
7532 IF SH= 1THEN SH= 0:GOTO 8600
7540 SH= 1
7550 GOSUB 8700
7560 GOTO 7010
7800 D2= CP(TP,A)
7810 IF D2> 100THEN 7830
7820 GOTO 7520
7830 REM
7840 FOR AA= 1TO PC(TP)
7850 IF CP(TP,AA)= 0THEN 7870
7855 IF CP(TP,AA)> 100THEN D3= CO:GOTO 7871
7860 D2= CP(TP,AA):GOSUB 120
7865 CO= D3:AA= 21
7870 NEXT AA
7871 GOSUB 100
7872 D2= CP(TP,A)
7875 IF CO= 1THEN 8000
7880 IF CO= 2THEN 8030
7885 IF CO= 3THEN 8040
7890 IF CO= 4THEN 8050
8000 PRINT "COLOR CHOSEN IS YELLOW"
8005 CO= 1
8010 GOSUB 110:GOSUB 100
8015 GOSUB 5000
8020 GOTO 7200
8030 PRINT "COLOR CHOSEN IS BLUE":CO= 2:GOTO 8010
8040 PRINT "COLOR CHOSEN IS RED":CO= 3:GOTO 8010
8050 PRINT "COLOR CHOSEN IS GREEN":CO= 4:GOTO 8010
8500 GOSUB 8700:GOSUB 8700
8510 GOSUB 8700:GOSUB 8700
8520 IF KD(1)> 104THEN KD(1)= 101
8600 IF TP= 2THEN 8650
8610 IF DN= 0THEN TP= 2:NP= 0:GOTO 8630
8620 TP= 0:NP= 2
8630 PLOT 14,6,3,3,18,5:PRINT "# 1"
8631 SH= 0
8635 PLOT 3,53,5:PRINT "# 2"
8636 GOSUB 5000
8638 IF TP= 0THEN 2000
8640 GOTO 6000
8650 IF DN= 0THEN TP= 0:NP= 1:GOTO 8670
8660 TP= 1:NP= 0
8670 GOTO 8630
8700 IF SK< 1THEN 3900
8710 GOSUB 190
8720 D5= DK(1):D2= D5
8730 GOSUB 120
8740 GOSUB 200
8750 SK= SK- 1:GOSUB 160
8760 X9= 26:Y9= 9:GOSUB 40970
8770 PC(TP)= PC(TP)+ 1
8775 PLOT 14,6,6,3,14+ (TP- 1)* 35,11
8776 PRINT RIGHT$ ((STR$ (PC(TP))),2)
8780 IF PC(TP)> 20THEN 9000
8790 FOR A= 1TO 20
8800 IF CP(TP,A)= 0THEN CP(TP,A)= D5:D1= A:GOTO 8820
8810 NEXT A
8820 GOSUB 13000
8890 RETURN
9000 REM  END OF JOB
9010 GOSUB 100
9015 OUT 8,255
9020 INPUT "PLAY AGAIN (Y/N) ? ";Q$
9025 OUT 8,247:GOSUB 100
9030 IF LEFT$ (Q$,1)< > "Y"THEN 9900
9040 PLOT 8,6,2,12
9050 GOSUB 10000
9090 GOTO 500
9900 OUT 8,255
9910 PLOT 6,2,27,11,15
9920 LOAD "MENU":RUN
9930 END
10000 REM  INITIALIZE EVERYTHING
10100 FOR A= 1TO 20:CP(1,A)= 0:CP(2,A)= 0:YC(A)= 0:NEXT A
10110 SW= 0
10999 RETURN
11000 REM  BLANK YOUR CARD AREA AND DRAW CARDS
11002 GOSUB 11010:GOTO 11020
11010 PLOT 14,6,2:FOR I= 19TO 27STEP 2:PLOT 3,1,I:PRINT BL$:NEXT I
11015 RETURN
11020 IF YD= 0THEN RETURN
11030 FOR I= YDTO 1STEP - 1
11040 X= YC(I):Y9= 19
11050 X9= 61- 3* I+ YD- 20
11060 GOSUB 40000
11062 PLOT 3,X9+ 1,27,14,6,6
11064 PRINT CHR$ (I+ 64)
11070 NEXT I
11080 RETURN
12000 REM  MOVE YOUR CARDS TO A UP, ELIMINATING BLANKS
12010 FOR I= 1TO YD+ 1
12020 DK(I+ 86)= YC(I)
12030 YC(I)= 0
12040 NEXT I
12050 CM= 1
12060 FOR I= 1TO YD+ 1
12070 IF DK(I+ 86)= 0THEN 12090
12080 YC(CM)= DK(I+ 86):CM= CM+ 1
12085 DK(I+ 86)= 0
12090 NEXT I
12100 RETURN
13000 REM  PLAYER #1 & 2 MOVE CARDS
13010 FOR I= 1TO PC(TP)+ 1:DK(I+ 86)= CP(TP,I):CP(TP,I)= 0:NEXT I
13020 CM= 1:FOR I= 1TO PC(TP)+ 1
13030 IF DK(I+ 86)= 0THEN 13060
13040 CP(TP,CM)= DK(I+ 86):CM= CM+ 1
13050 DK(I+ 86)= 0
13060 NEXT I
13070 RETURN
40000 REM  DRAW UNO CARD
40010 REM  108 CARDS, 4 COLORS; 2 EACH 1-9,DRAW 2,REVERSE,SKIP, 1 0;4 WILD, 4 DRAW 4
40020 REM  1-25 YELLOW;  26-50 BLUE;  51-75 RED;  76-100 GREEN; 101-104 WILD; 105-108 DRAW 4
40030 REM  ON ENTRY, X=1-108; X9=UPPER LEFT X CURSOR; Y9=UPPER LEFT Y CURSOR
40040 IF X> 108OR X< 1THEN RETURN
40045 PLOT 15
40050 X1= X
40060 IF X1> 100THEN 40130
40070 X2= 1
40080 FOR X3= 1TO 4
40090 IF X1> 25THEN X1= X1- 25:X2= X2+ 1
40100 NEXT X3
40110 REM  X1 IS NOW 1-25; X2 IS 1-4
40120 GOTO 40390
40130 IF X1> 104THEN 40330:REM  DRAW 4
40140 REM  WILD
40150 GOSUB 40160:GOTO 40210
40160 PLOT 6,56
40170 FOR X3= 0TO 6
40180 PLOT 3,X9,Y9+ X3:PRINT "     "
40190 NEXT X3
40200 GOTO 40860
40210 PLOT 27,10,3,X9,Y9:PRINT "W I L D"
40220 PLOT 3,X9+ 4,Y9:PRINT "W I L D"
40230 PLOT 27,24
40240 PLOT 3,X9+ 1,Y9+ 1
40250 PRINT "tW "
40260 PLOT 3,X9+ 1,Y9+ 2
40270 PRINT " I "
40280 PLOT 3,X9+ 1,Y9+ 3
40290 PRINT " L "
40300 PLOT 3,X9+ 1,Y9+ 4
40310 PRINT " Dw"
40320 GOTO 40860
40330 REM  DRAW 4
40340 GOSUB 40160
40350 PLOT 27,10,3,X9,Y9,6,56:PRINT "DRAW"
40360 PLOT 3,X9+ 4,Y9:PRINT "DRAW"
40370 PLOT 27,24,14,3,X9,Y9+ 6:PRINT "4   4"
40380 PLOT 15:GOTO 40230
40390 REM
40400 IF X1= 10THEN X4= 0:GOTO 40440
40410 IF X1> 19THEN 40760
40420 IF X1> 10THEN X4= X1- 10:GOTO 40440
40430 X4= X1
40440 GOSUB 40450:GOTO 40670
40450 REM  X4=1 TO 9 OR 0
40460 IF X2= 1THEN X5= 24:X6= 3
40470 IF X2= 2THEN X5= 38:X6= 52
40480 IF X2= 3THEN X5= 15:X6= 57
40490 IF X2= 4THEN X5= 16:X6= 2
40500 IF X2= 5THEN X5= 56:X6= 7
40510 PLOT 6,X5,15
40520 FOR X3= 0TO 6
40530 PLOT 3,X9,Y9+ X3
40540 PRINT "     "
40550 NEXT X3
40560 PLOT 6,X6
40570 FOR X3= 1TO 5
40580 PLOT 3,X9+ 1,Y9+ X3
40590 PRINT "   "
40600 NEXT X3
40610 PLOT 3,X9+ 1,Y9+ 1
40620 PLOT 6,X5
40630 PRINT "t"
40640 PLOT 3,X9+ 3,Y9+ 5
40650 PRINT "w"
40660 RETURN
40670 A$= CHR$ (X4+ 48)
40680 PLOT 14,6,X5
40690 PLOT 3,X9,Y9+ 2
40700 PRINT A$
40710 PLOT 3,X9+ 4,Y9+ 6
40720 PRINT A$
40730 PLOT 6,X6,3,X9+ 2,Y9+ 4
40740 PRINT A$
40750 RETURN
40760 IF X1> 23THEN 40920
40770 IF X1> 21THEN 40870
40780 GOSUB 40450
40790 PLOT 27,10,6,X5,3,X9,Y9+ 1
40800 PRINT "DRAW"
40810 PLOT 3,X9+ 4,Y9+ 1:PRINT "DRAW"
40820 PLOT 14,3,X9,Y9+ 6:PRINT "2"
40830 PLOT 3,X9+ 4,Y9+ 6:PRINT "2"
40840 PLOT 27,24,6,X6,3,X9+ 2,Y9+ 4
40850 PRINT "D"
40860 PLOT 27,24,15:RETURN
40870 GOSUB 40450
40880 PLOT 27,10,6,X5,3,X9,Y9:PRINT "REVERSE"
40890 PLOT 3,X9+ 4,Y9:PRINT "REVERSE"
40900 PLOT 14,6,X6,3,X9+ 2,Y9+ 4:PRINT "R"
40910 GOTO 40860
40920 GOSUB 40450
40930 PLOT 27,10,6,X5,3,X9,Y9:PRINT "S K I P"
40940 PLOT 3,X9+ 4,Y9:PRINT "S K I P"
40950 PLOT 14,6,X6,3,X9+ 2,Y9+ 4:PRINT "S"
40960 GOTO 40860
40970 REM  PRINT BACK OF CARD
40980 X2= 5
40990 GOSUB 40450
41000 PLOT 14,6,1
41020 PLOT 3,X9+ 1,Y9+ 4
41025 PRINT "UNO"
41030 PLOT 15
41100 PLOT 3,X9+ 1,Y9+ 1
41110 PRINT "  u"
41120 PLOT 3,X9+ 1,Y9+ 5
41130 PRINT "v  "
41900 GOTO 40860
42000 REM  SHUFFLE CARDS
42010 FOR A= 1TO 108:KD(1)= 0:NEXT A
42020 GOSUB 100
42022 PLOT 6,4,15,3,47,31
42024 PRINT "REPLY 'Z' TO QUIT"
42026 PLOT 14,3,0,31,6,7
42028 PRINT "SHUFFLING: "
42029 PLOT 6,1
42030 FOR B= 108TO 1STEP - 1
42035 PLOT 3,10,31
42040 A= INT (108* RND (1)+ 1)
42042 D= PEEK (33209)
42044 IF A= DTHEN FOR C= 0TO D:E= RND (1):NEXT C
42050 IF KD(A)= 1THEN 42040
42055 IF B= 22THEN 42200
42060 DK(B)= A
42065 IF DK(B)= 102THEN DK(B)= 101
42066 IF DK(B)= 103THEN DK(B)= 101
42067 IF DK(B)= 104THEN DK(B)= 101
42070 KD(A)= 1
42080 PRINT B;" "
42100 NEXT B
42110 PRINT
42120 GOSUB 100
42130 RETURN
42200 IF A> 100THEN 42040
42210 D2= A:GOSUB 120
42220 IF D2> 19AND D2< 26THEN 42040
42230 GOTO 42060
43000 END