Compucolor.org – Virtual Media

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

1 REM  COPYRIGHT 1978 80-NW PUBLISHING TACOMA WA
2 REM  ALL RIGHTS RESERVED
3 PLOT 12,15
4 REM  PUBLISHED IN CREATIVE COMPUTING JUNE 1981
5 REM  EXTENSIVELY MODIFIED BY M.J.ALLAN FOR COMPUCOLOR II
6 REM  MACHINE LANGUAGE GRAPHICS ADDED
7 CLEAR  100
9 PLOT 12,27,24:GOSUB 10020
10 DUMMY= RND (- PEEK (33209))
20 POKE 33283,16:POKE 33284,248
22 BLANK$= "          "
23 DEF FN A(X)= INT (X* RND (1))+ 1
25 GOTO 900
30 CL= INT ((YA+ 5)/ 6):POKE 63488,XA:POKE 63489,YA:POKE 63490,CL:POKE 63491,DN
32 DU= CALL (DU)
34 RETURN
40 CL= INT ((Y+ 5)/ 6):POKE 63488,X:POKE 63489,Y:POKE 63490,CL:POKE 63491,DN
42 DU= CALL (DU)
44 RETURN
50 MD$= "RIDICULOUS":RETURN
51 MD$= "ABSURD":RETURN
52 MD$= "GROTESQUE":RETURN
53 MD$= "NONSENSICAL":RETURN
54 MD$= "FARCICAL":RETURN
55 MD$= "PREPOSTEROUS":RETURN
56 MD$= "SILLY":RETURN
57 MD$= "SENSELESS":RETURN
58 MD$= "IRRATIONAL":RETURN
59 MD$= "FANTASTIC":RETURN
60 MD$= "ODD":RETURN
61 MD$= "RUDE":RETURN
62 MD$= "BRUTISH":RETURN
63 MD$= "BARBARIC":RETURN
64 MD$= "PLEBEIAN":RETURN
65 MD$= "UNCIVAL":RETURN
66 MD$= "DISCOURTEOUS":RETURN
67 MD$= "VULGAR":RETURN
68 MD$= "COARSE":RETURN
69 MD$= "GROSS":RETURN
70 MD$= "UNGRACEFUL":RETURN
71 MD$= "MONSTROUS":RETURN
72 MD$= "HORRID":RETURN
73 MD$= "SHOCKING":RETURN
74 MD$= "CHEAP":RETURN
900 GOSUB 9000
1000 PLOT 12,3,25,0:PRINT CHR$ (34);"ANDROID NIM";CHR$ (34)
1005 X= 2:Y= 1:GOSUB 8000:DN= 20:GOSUB 40
1010 X= 5:Y= 11:GOSUB 8000:DN= 20:GOSUB 40
1011 X= 2:Y= 21:GOSUB 8000:DN= 20:GOSUB 40
1012 Y9= 1:RW$(1)= "0":RW$(2)= "0":RW$(3)= "0"
1013 GOSUB 1040:GOTO 1050
1016 GOSUB 2800
1017 RW$(1)= "7":RW$(2)= "5":RW$(3)= "3"
1018 GOTO 8200
1040 NX= 13:FOR NY= 1TO 10:PLOT 3,NX,NY:PRINT BL$;BL$;BL$;BL$;BL$;" ":NEXT
1042 NX= 18:FOR NY= 11TO 21:PLOT 3,NX,NY:PRINT BL$;BL$;BL$;BL$;"      ":NEXT
1044 NX= 26:FOR NY= 21TO 30:PLOT 3,NX,NY:PRINT BL$;BL$;BL$;"        ":NEXT
1046 PLOT 3,10,0:PRINT "             ";:RETURN
1050 POKE 33278,0:PLOT 3,28,16
1052 PRINT "FIRST MOVE BY YOU (1) OR ME (2)?     "
1054 PLOT 3,61,16:GOTO 1060
1055 X= 2:Y= 1:GOSUB 8005:X= 5:Y= 11:GOSUB 8005:X= 2:Y= 21:GOSUB 8005:RETURN
1060 GOSUB 2000:GOSUB 20000:K$= INKEY$:IF K$= ""THEN 1060
1061 IF K$= "1"THEN 1110
1062 IF K$= "2"THEN 1075
1063 IF K$= "Y"THEN 1068
1064 IF K$= "M"THEN 1099
1066 GOTO 1500
1068 GOSUB 20000:E$= INKEY$:IF E$= ""THEN 1068
1069 GOSUB 1055
1070 GOSUB 20000:Y$= INKEY$:IF Y$= ""THEN 1070
1071 K$= K$+ E$+ Y$:IF K$< > "YOU"THEN 1500
1075 X9= 2:PLOT 3,28,16:PRINT "OK, I'LL START !                     "
1076 FOR O= 1TO 12:GOSUB 2000:NEXT
1077 PLOT 3,28,16:PRINT "                                    ";:GOTO 1016
1099 GOSUB 1055
1100 GOSUB 20000:E$= INKEY$:IF E$= ""THEN 1100
1101 K$= K$+ E$:IF K$< > "ME"THEN 1500
1110 X9= 1:PLOT 3,28,16:PRINT "VERY WELL , YOU MAY START !          "
1111 PLOT 3,61,16
1112 X= 5:Y= 11:GOSUB 8010:X= 2:Y= 21:GOSUB 8010:X= 2:Y= 1:GOSUB 8010
1114 FOR M= 1TO 12:GOSUB 2000:NEXT
1116 PLOT 3,28,16:PRINT "                                     ":GOTO 1016
1500 PLOT 3,28,16:PRINT "WHICH ONE OF US IS , ";CHR$ (34);K$;CHR$ (34);" ?         "
1510 X= 2:Y= 21:GOSUB 8010:X= 2:Y= 1:GOSUB 8010:X= 5:Y= 11:GOSUB 8010:GOSUB 8112:GOTO 1050
2000 M= FN A(16):K= FN A(50)+ 50:YY= FN A(18)
2002 GOSUB 2070
2004 IF X3= XAND Y3= YTHEN 2000
2010 IF X3= 0AND Y3= 0THEN 2040
2020 IF M< 8OR M> 12THEN 2040
2030 GOTO 2000
2040 IF M> 7THEN 8089
2050 ON MGOSUB 8005,8015,8030,8035,8055,8060,8065
2060 GOTO 8079
2070 IF YY> 9THEN 2090
2080 ON YYGOTO 8076,8077,8078,7951,7952,7953,7954,7955,7956
2090 ON YY- 9GOTO 7957,7961,7962,7963,7964,7965,7971,7972,7973
2200 RETURN
2210 DN= 11:GOSUB 40
2220 DN= 8:XA= 34:YA= 1:GOSUB 30
2230 DN= 5:XA= 41:YA= 1:GOSUB 30
2235 RETURN
2240 DN= 5:GOSUB 40
2250 DN= 0:XA= 48:YA= 1:GOSUB 30
2260 RETURN
2270 RETURN
2280 DN= 29:GOSUB 40
2290 DN= 8:XA= 48:YA= 1:GOSUB 30
2300 RETURN
2310 DN= 5:GOSUB 40
2320 DN= 8:XA= 55:YA= 1:GOSUB 30
2330 RETURN
2340 RETURN
2350 DN= 5:GOSUB 40
2360 DN= 8:XA= 34:YA= 11:GOSUB 30
2370 DN= 0:XA= 50:YA= 11:GOSUB 30
2380 RETURN
2390 DN= 0:GOSUB 40
2400 DN= 11:XA= 34:YA= 11:GOSUB 30
2410 RETURN
2420 DN= 29:GOSUB 40
2430 DN= 5:XA= 42:YA= 11:GOSUB 30
2440 RETURN
2450 RETURN
2460 DN= 5:GOSUB 40
2470 XA= 42:YA= 11:DN= 8:GOSUB 30
2480 RETURN
2490 DN= 0:GOSUB 40
2500 XA= 50:YA= 11:DN= 11:GOSUB 30
2510 RETURN
2520 RETURN
2530 DN= 11:GOSUB 40
2540 XA= 43:YA= 21:DN= 29:GOSUB 30
2550 RETURN
2560 IF X3< > 0AND Y3< > 0THEN RETURN
2570 DN= 5:GOSUB 40
2580 XA= 2:YA= 1:DN= 8:GOSUB 30
2590 RETURN
2600 IF X3< > 0AND Y3< > 0THEN
2610 DN= 0:GOSUB 40
2620 XA= 5:YA= 11:DN= 11:GOSUB 30
2630 RETURN
2640 IF X3< > 0AND Y3< > 0THEN
2650 DN= 5:GOSUB 40
2660 XA= 2:YA= 21:DN= 8:GOSUB 30
2670 RETURN
2700 XA= 2:YA= 1:DN= 11:GOSUB 30
2702 XA= 5:YA= 11:DN= 5:GOSUB 30
2704 GOSUB 8100:RETURN
2710 XA= 2:YA= 1:DN= 29:GOSUB 30
2712 XA= 2:YA= 21:DN= 8:GOSUB 30
2714 GOSUB 8100:RETURN
2720 XA= 5:YA= 11:DN= 0:GOSUB 30
2722 XA= 2:YA= 21:DN= 11:GOSUB 30
2724 GOSUB 8100:RETURN
2730 XA= 2:YA= 1:DN= 29:GOSUB 30
2732 XA= 5:YA= 11:DN= 8:GOSUB 30
2734 XA= 2:YA= 21:DN= 11:GOSUB 30
2736 GOSUB 8100:RETURN
2740 XA= 5:YA= 11:DN= 11:GOSUB 30
2742 XA= 2:YA= 1:DN= 29:GOSUB 30
2744 GOSUB 8100:RETURN
2750 IF X= 2AND Y= 1THEN 8120
2752 IF X= 5AND Y= 11THEN 8120
2754 IF X= 2AND Y= 21THEN 8120
2756 DN= 27:GOSUB 40
2758 GOSUB 8100:RETURN
2760 IF X= 2AND Y= 1THEN 8130
2762 IF X= 5AND Y= 11THEN 8130
2764 IF X= 2AND Y= 21THEN 8130
2766 DN= 2:GOSUB 40
2768 GOSUB 8100:RETURN
2770 DN= 28:GOSUB 40
2772 GOSUB 8100:RETURN
2780 DN= 22:GOSUB 40
2782 GOSUB 8100:RETURN
2800 X= 62:Y= 1:FOR N= 1TO 7:X= X- 7:GOSUB 8000:NEXT
2810 X= 58:Y= 11:FOR N= 1TO 5:X= X- 8:GOSUB 8000:NEXT
2820 X= 52:Y= 21:FOR N= 1TO 3:X= X- 9:GOSUB 8000:NEXT
2830 RETURN
2900 FOR O= Q3- 4TO Q3+ 5
2910 PLOT 3,Z5,O:PRINT FA$
2920 NEXT
2930 FOR O= Q3- 4TO Q3+ 5
2940 PLOT 3,Z5,O:PRINT FB$
2950 NEXT
2960 RETURN
7000 PLOT 3,10,0:PRINT "MY TURN      "
7005 ON Y9GOTO 7020,7010,7010
7006 GOTO 7200
7010 M= FN A(2):ON MGOTO 7020,7200
7020 FOR O= 1TO 12:GOSUB 2000:NEXT :GOTO 7275
7200 Z= 1:GOSUB 7500:Z1= Z0
7202 Z= 2:GOSUB 7500:Z2= Z0
7204 Z= 3:GOSUB 7500:Z3= Z0
7210 Z4= Z1+ Z2:Z5= Z1+ Z3:Z6= Z2+ Z3
7212 Z4$= STR$ (Z4):Z5$= STR$ (Z5):Z6$= STR$ (Z6)
7220 GOSUB 2000:IF Z4= 0THEN 7230
7221 Z0= LEN (Z4$):Y0= 1:Z4= 0:FOR N= Z0TO 1STEP - 1
7222 IF MID$ (Z4$,N,1)= "1"THEN Z4= Z4+ Y0
7223 Y0= Y0* 2:NEXT N
7230 GOSUB 2000:IF Z5= 0THEN 7240
7231 Z0= LEN (Z5$):Y0= 1:Z5= 0:FOR N= Z0TO 1STEP - 1
7232 IF MID$ (Z5$,N,1)= "1"THEN Z5= Z5+ Y0
7233 Y0= Y0* 2:NEXT N
7240 GOSUB 2000:IF Z6= 0THEN 7250
7241 Z0= LEN (Z6$):Y0= 1:Z6= 0:FOR N= Z0TO 1STEP - 1
7242 IF MID$ (Z6$,N,1)= "1"THEN Z6= Z6+ Y0
7243 Y0= Y0* 2:NEXT N
7245 GOSUB 2000
7250 IF VAL (RW$(3))< = Z4THEN 7255
7251 RW= 3:RN= VAL (RW$(3))- Z4
7253 RN$= STR$ (RN):RN$= RIGHT$ (RN$,1):X9= 1:GOTO 8240
7255 IF VAL (RW$(2))< = Z5THEN 7260
7256 RW= 2:RN= VAL (RW$(2))- Z5:GOTO 7253
7260 IF VAL (RW$(1))< = Z6THEN 7270
7261 RW= 1:RN= VAL (RW$(1))- Z6:GOTO 7253
7270 GOSUB 2000:X8= 0:IF Z4= 0AND Z5= 0THEN 7300
7275 M= FN A(3)
7276 ON MGOTO 7277,7278,7279
7277 IF VAL (RW$(1))< > 0THEN RW= 1:GOSUB 7290:X9= 1:X8= 0:GOTO 8240
7278 IF VAL (RW$(2))< > 0THEN RW= 2:GOSUB 7290:X9= 1:X8= 0:GOTO 8240
7279 IF VAL (RW$(3))< > 0THEN RW= 3:GOSUB 7290:X9= 1:X8= 0:GOTO 8240
7280 GOTO 7277
7290 M= FN A(7):ON MGOTO 7291,7292,7293,7294,7295,7296,7297
7291 RN= 1:RN$= "1":RETURN
7292 GOTO 7291
7293 GOTO 7291
7294 GOTO 7291
7295 RN= 2:RN$= "2":RETURN
7296 RN= 3:RN$= "3":RETURN
7297 IF RW= 3THEN 7296
7298 RN= 4:RN$= "4":RETURN
7300 GOTO 7350
7350 GOSUB 1040
7360 IF X9= 1THEN 7400
7370 GOSUB 7550:GOSUB 2000:X= 2:Y= 1:GOSUB 8035:GOSUB 8114
7371 X= 2:Y= 21:GOSUB 8035:GOSUB 8116
7372 X= 5:Y= 11:GOSUB 8035:GOSUB 8114
7373 DN= 19:XA= 5:YA= 11:GOSUB 30:XA= 2:YA= 21:GOSUB 30:XA= 2:YA= 1:GOSUB 30
7374 DN= 29:XA= 2:YA= 1:GOSUB 30
7375 DN= 29:XA= 2:YA= 21:GOSUB 30:XA= 5:YA= 11:GOSUB 30
7380 GOTO 7420
7400 GOSUB 1055
7402 PLOT 3,24,16,14:PRINT "I  W I N"
7406 PLOT 15
7408 GOSUB 8112:GOSUB 8112
7420 PLOT 3,26,24:PRINT "NEW GAME (Y OR N)? ";
7425 GOSUB 2000:GOSUB 20000:K$= INKEY$
7426 IF K$= ""THEN 7425
7427 IF K$= "Y"THEN 1012
7430 PLOT 12,27,11,1
7450 GOSUB 1040
7460 RW$(1)= "0":RW$(2)= "0":RW$(3)= "0"
7470 PLOT 3,28,16:PRINT "SINCE YOU HAVE GIVEN UP...";
7480 FOR O= 1TO 8:GOSUB 2000:NEXT
7490 GOSUB 1040:GOTO 7400
7500 ON VAL (RW$(Z))+ 1GOTO 7505,7510,7515,7520,7525,7530,7535,7540
7505 Z0= 0:RETURN
7510 Z0= 1:RETURN
7515 Z0= 10:RETURN
7520 Z0= 11:RETURN
7525 Z0= 100:RETURN
7530 Z0= 101:RETURN
7535 Z0= 110:RETURN
7540 Z0= 111:RETURN
7550 GOSUB 7700:W1$= MD$
7552 GOSUB 7700:IF MD$= W1$THEN 7552
7554 W2$= MD$
7556 GOSUB 7700:IF MD$= W1$OR MD$= W2$THEN 7556
7558 W3$= MD$
7560 GOSUB 7700:IF MD$= W1$OR MD$= W2$OR MD$= W3$THEN 7560
7562 W4$= MD$
7564 GOSUB 7700:IF MD$= W1$OR MD$= W2$OR MD$= W3$OR MD$= W4$THEN 7564
7566 W5$= MD$
7568 GOSUB 7700:IF MD$= W1$OR MD$= W2$OR MD$= W3$OR MD$= W4$OR MD$= W5$THEN 7568
7570 W6$= MD$
7572 GOSUB 7700
7574 IF MD$= W1$OR MD$= W2$OR MD$= W3$OR MD$= W4$OR MD$= W5$OR MD$= W6$THEN 7572
7576 W7$= MD$
7610 PLOT 3,28,11:PRINT "THROUGH SOME ";W1$+ ",":GOSUB 8118
7612 PLOT 3,22,12:PRINT W2$+ ",":GOSUB 8118
7614 PLOT 3,22,12:PRINT W2$+ ", "+ W3$+ ",":GOSUB 8118
7616 PLOT 3,22,12:PRINT W2$+ ", "+ W3$+ ", "+ W4$+ ",":GOSUB 8118
7620 PLOT 3,22,13:PRINT W5$+ ",":GOSUB 2000
7622 PLOT 3,22,13:PRINT W5$+ ", "+ W6$+ ",":GOSUB 2000
7624 PLOT 3,22,13:PRINT W5$+ ", "+ W6$+ ", "+ W7$+ ",":GOSUB 2000
7630 PLOT 3,34,14:PRINT "STROKE OF FATE...":GOSUB 8118
7632 PLOT 3,38,15:PRINT "YOU WIN !"
7640 RETURN
7700 M= FN A(25)
7705 ON MGOSUB 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
7710 RETURN
7951 IF VAL (RW$(1))> 6THEN X= 13:Y= 1:RETURN
7952 IF VAL (RW$(1))> 5THEN X= 20:Y= 1:GOTO 7975
7953 IF VAL (RW$(1))> 4THEN X= 27:Y= 1:RETURN
7954 IF VAL (RW$(1))> 3THEN X= 34:Y= 1:RETURN
7955 IF VAL (RW$(1))> 2THEN X= 41:Y= 1:GOTO 7979
7956 IF VAL (RW$(1))> 1THEN X= 48:Y= 1:RETURN
7957 IF VAL (RW$(1))> 0THEN X= 55:Y= 1:RETURN
7958 X= 2:Y= 1:RETURN
7961 IF VAL (RW$(2))> 4THEN X= 18:Y= 11:RETURN
7962 IF VAL (RW$(2))> 3THEN X= 26:Y= 11:GOTO 7983
7963 IF VAL (RW$(2))> 2THEN X= 34:Y= 11:GOTO 7988
7964 IF VAL (RW$(2))> 1THEN X= 42:Y= 11:RETURN
7965 IF VAL (RW$(2))> 0THEN X= 50:Y= 11:RETURN
7966 X= 5:Y= 11:RETURN
7971 IF VAL (RW$(3))> 2THEN X= 25:Y= 21:RETURN
7972 IF VAL (RW$(3))> 1THEN X= 34:Y= 21:GOTO 7992
7973 IF VAL (RW$(3))> 0THEN X= 43:Y= 21:RETURN
7974 X= 2:Y= 21:RETURN
7975 N= FN A(3):ON NGOTO 2200,2210,2240
7979 N= FN A(3):ON NGOTO 2270,2280,2310
7983 N= FN A(4):ON NGOTO 2340,2350,2390,2420
7988 N= FN A(3):ON NGOTO 2450,2460,2490
7992 N= FN A(6):ON NGOTO 2520,2530,2560,2600,2640,2520
8000 DN= 0:GOSUB 40:DN= 2:GOSUB 40:DN= 4:GOSUB 40:RETURN
8005 GOSUB 8100:DN= 5:GOSUB 40
8006 GOSUB 8100:DN= 31:GOSUB 40
8007 GOSUB 8100:DN= 7:GOSUB 40
8008 RETURN
8010 GOSUB 8100:DN= 31:GOSUB 40
8011 GOSUB 8100:DN= 5:GOSUB 40
8012 GOSUB 8100:DN= 0:GOSUB 40
8013 RETURN
8015 GOSUB 8100:DN= 8:GOSUB 40
8016 GOSUB 8100:DN= 33:GOSUB 40
8017 GOSUB 8100:DN= 10:GOSUB 40
8018 RETURN
8020 GOSUB 8100:DN= 33:GOSUB 40
8021 GOSUB 8100:DN= 8:GOSUB 40
8022 GOSUB 8100:DN= 0:GOSUB 40
8023 RETURN
8025 M= FN A(2)+ 1:FOR L= 1TO M
8026 GOSUB 8100:DN= 8:GOSUB 40
8027 GOSUB 8100:DN= 0:GOSUB 40
8028 GOSUB 8100:DN= 5:GOSUB 40
8029 GOSUB 8100:DN= 0:GOSUB 40:NEXT :RETURN
8030 GOSUB 8100:DN= 11:GOSUB 40:RETURN
8035 GOSUB 8100:DN= 29:GOSUB 40:RETURN
8040 M= FN A(3):FOR L= 1TO M
8041 GOSUB 8030:GOSUB 8100:DN= 0:GOSUB 40
8042 GOSUB 8035:GOSUB 8100:DN= 0:GOSUB 40
8043 NEXT :RETURN
8045 GOSUB 8100:DN= 21:GOSUB 40:GOSUB 8100:DN= 22:GOSUB 40
8046 GOSUB 8100:DN= 23:GOSUB 40:GOSUB 8100:DN= 24:GOSUB 40
8047 GOSUB 8100:DN= 25:GOSUB 40
8048 RETURN
8050 GOSUB 8100:DN= 24:GOSUB 40:X3= X:Y3= Y:GOSUB 2000:GOSUB 2000
8051 X= X3:Y= Y3:GOSUB 8110:DN= 23:GOSUB 40
8052 GOSUB 8100:DN= 22:GOSUB 40:GOSUB 8100:DN= 21:GOSUB 40
8053 GOSUB 8110:DN= 26:GOSUB 40
8054 RETURN
8055 GOSUB 8100:DN= 5:GOSUB 40:RETURN
8060 GOSUB 8100:DN= 8:GOSUB 40:RETURN
8065 GOSUB 8100:DN= 0:GOSUB 40:RETURN
8076 X= 2:Y= 1:RETURN
8077 X= 5:Y= 11:RETURN
8078 X= 2:Y= 21:RETURN
8079 X1= FN A(5)
8080 ON X1GOTO 8081,2000,8081,2000,8081
8081 ON MGOTO 8087,8088,8082,8083,8084,8085,8086
8082 DN= 16:GOSUB 40:GOSUB 8100:DN= 11:GOSUB 40:RETURN
8083 DN= 19:GOSUB 40:GOSUB 8100:DN= 29:GOSUB 40:RETURN
8084 DN= 14:GOSUB 40:GOSUB 8100:DN= 5:GOSUB 40:RETURN
8085 DN= 15:GOSUB 40:GOSUB 8100:DN= 8:GOSUB 40:RETURN
8086 DN= 13:GOSUB 40:GOSUB 8100:DN= 0:GOSUB 40:RETURN
8087 DN= 17:GOSUB 40:GOSUB 8100:DN= 7:GOSUB 40:RETURN
8088 DN= 18:GOSUB 40:GOSUB 8100:DN= 10:GOSUB 40:RETURN
8089 ON M- 7GOTO 2700,2710,2720,2730,2740,2750,2760,2770,2780
8100 FOR N= 1TO 8:NEXT :RETURN
8110 FOR N= 1TO 50:NEXT :RETURN
8112 FOR N= 1TO 1000:NEXT :RETURN
8114 FOR N= 1TO 200:NEXT :RETURN
8116 FOR N= 1TO 100:NEXT :RETURN
8118 FOR O= 1TO 3:GOSUB 2000:NEXT :RETURN
8120 DN= 27:GOSUB 40
8122 DN= 20:GOSUB 40
8124 GOSUB 8100:RETURN
8130 DN= 2:GOSUB 40
8132 DN= 20:GOSUB 40
8134 GOSUB 8100:RETURN
8200 X8= 0:IF X9= 2THEN 7000
8201 PLOT 3,10,0:PRINT "WHICH ROW?   "
8202 X3= 0:Y3= 0
8203 GOSUB 2000:GOSUB 20000:PLOT 3,21,0:K$= INKEY$:IF K$= ""THEN 8203
8204 IF K$> "0"AND K$< "4"THEN 8210
8206 IF K$= "R"THEN 7450
8208 GOTO 8200
8210 RW= VAL (K$):PLOT 3,10,0:PRINT "HOW MANY?    ":PLOT 3,0,RW* 10- 6
8220 GOSUB 2000:GOSUB 20000:K$= INKEY$:IF K$= ""THEN 8220
8222 IF K$> "0"AND K$< "8"THEN 8228
8224 IF K$< > " "THEN 8220
8226 GOSUB 8325:GOTO 8200
8228 X9= 2:PLOT 3,10,0:PRINT "             "
8230 RN$= K$:RN= VAL (RN$)
8240 IF RN> VAL (RW$(RW))AND X9= 1THEN X8= 1
8243 IF RN> VAL (RW$(RW))AND X9= 2THEN X9= 1
8245 ON RWGOSUB 8260,8270,8280
8247 IF VAL (RW$(1))= 0AND VAL (RW$(2))= 0AND VAL (RW$(3))= 0THEN 7300
8250 IF X8= 0THEN 8200
8252 GOTO 7270
8260 PLOT 3,0,4:PRINT RN$
8262 X= 2:Y= 1:GOTO 8300
8270 PLOT 3,0,14:PRINT RN$
8272 X= 5:Y= 11:GOTO 8300
8280 PLOT 3,0,24:PRINT RN$
8282 X= 2:Y= 21:GOTO 8300
8300 GOSUB 8015:X3= X:Y3= Y:GOSUB 2000
8302 X= X3:Y= Y3:GOSUB 8060
8304 GOSUB 8005:X3= X:Y3= Y:GOSUB 2000
8306 X= X3:Y= Y3:GOSUB 8010
8310 IF RN> VAL (RW$(RW))THEN 8320
8312 GOTO 8400
8320 GOSUB 8025
8325 PLOT 3,0,RW* 10- 6:PRINT "  ":RETURN
8400 GOTO 8405
8401 GOSUB 8040:X3= X:Y3= Y:GOSUB 2000:X= X3:Y= Y3:GOSUB 8005
8402 X3= X:Y3= Y:GOSUB 2000:GOSUB 2000:X= X3:Y= Y3:GOSUB 8045
8403 GOSUB 8450:NEXT N
8404 GOSUB 8500:GOSUB 8050:GOSUB 8010:GOTO 8325
8405 GOSUB 8040:GOSUB 8005
8406 X3= X:Y3= Y:GOSUB 2000
8407 X= X3:Y= Y3:GOSUB 8045
8408 GOSUB 8450:GOSUB 8500:GOSUB 8050:GOSUB 8010:GOTO 8325
8450 ON RWGOTO 8460,8470,8480
8460 X= 62:Y= 1:IF VAL (RW$(1))< > 0THEN FOR O= 1TO VAL (RW$(1)):X= X- 7:GOSUB 8015:NEXT
8461 X= 5:Y= 11:GOSUB 8030:X= 58:IF VAL (RW$(2))< > 0THEN FOR O= 1TO VAL (RW$(2)):X= X- 8:GOSUB 8030:NEXT
8462 X= 2:Y= 21:GOSUB 8030:X= 52:IF VAL (RW$(3))< > 0THEN FOR O= 1TO VAL (RW$(3)):X= X- 9:GOSUB 8030:NEXT
8463 X= 2:Y= 1:RETURN
8470 X= 58:Y= 11:IF VAL (RW$(2))< > 0THEN FOR O= 1TO VAL (RW$(2)):X= X- 8:GOSUB 8015:NEXT
8471 X= 2:Y= 1:GOSUB 8035:X= 62:IF VAL (RW$(1))< > 0THEN FOR O= 1TO VAL (RW$(1)):X= X- 7:GOSUB 8035:NEXT
8472 X= 2:Y= 21:GOSUB 8030:X= 52:IF VAL (RW$(3))< > 0THEN FOR O= 1TO VAL (RW$(3)):X= X- 9:GOSUB 8030:NEXT
8473 X= 5:Y= 11:RETURN
8480 X= 52:Y= 21:IF VAL (RW$(3))< > 0THEN FOR O= 1TO VAL (RW$(3)):X= X- 9:GOSUB 8015:NEXT
8481 X= 5:Y= 11:GOSUB 8035:X= 58:IF VAL (RW$(2))< > 0THEN FOR O= 1TO VAL (RW$(2)):X= X- 8:GOSUB 8035:NEXT
8482 X= 2:Y= 1:GOSUB 8035:X= 62:IF VAL (RW$(1))< > 0THEN FOR O= 1TO VAL (RW$(1)):X= X- 7:GOSUB 8035:NEXT
8483 X= 2:Y= 21:RETURN
8500 Z1= VAL (RW$(RW))
8505 Z2= Z1* RN
8510 RW$(RW)= STR$ (Z1- RN)
8520 ON RWGOTO 8530,8540,8550
8530 Z$= "===-":Z3= 13:Q3= 5:Z4= 7:Z5= 62- 7* Z1:GOTO 8560
8540 Z$= "===-":Z3= 16:Q3= 15:Z4= 8:Z5= 58- 8* Z1:GOTO 8560
8550 Z$= "===-":Z3= 13:Q3= 25:Z4= 9:Z5= 52- 9* Z1:GOTO 8560
8560 FOR M= 1TO RN
8562 PLOT 3,Z3- 1,Q3:PRINT "="
8564 FOR N= Z3TO Z5STEP 3
8566 PLOT 3,Z3- 1,Q3:PRINT "-":PLOT 3,N,Q3:PRINT Z$
8567 PLOT 3,Z3- 1,Q3:PRINT "="
8568 NEXT N
8569 GOSUB 2900
8572 FOR N= Z3TO Z5STEP 3
8574 PLOT 3,N,Q3:PRINT "    "
8576 NEXT N
8580 Z5= Z5+ Z4
8582 NEXT M
8590 Y9= Y9+ 1:X3= X:Y3= Y:GOSUB 2000:X= X3:Y= Y3:RETURN
9000 REM  LOAD GRAPHICS ROUTINE
9020 PLOT 27,4:PRINT "LOAD ANDY32.PRG":PLOT 27,27
9030 REM  TWO CCII VERSIONS
9040 Z= PEEK (0001):IF Z< > 186THEN POKE 63505,208:POKE 63506,63
9410 FA$= "``````"
9420 FB$= "      "
9430 RETURN
10000 PLOT 12:GOSUB 7550
10010 GOSUB 20000:K$= INKEY$:IF K$= ""THEN 10010
10012 GOTO 10000
10020 REM  PRINT INSTRUCTIONS
10030 PRINT :PLOT 14:PRINT TAB( 25);"ANDROID NIM":PLOT 15
10040 PRINT :PRINT "     THIS IS THE GAME OF NIM PLAYED USING ANDROIDS.":PRINT
10080 PRINT :PRINT "RULES - YOU MAY REMOVE AS MANY ANDROIDS FROM ANY"
10090 PRINT "ROW AS YOU WISH WHEN IT IS YOUR TURN. TO WIN YOU MUST"
10100 PRINT "REMOVE THE LAST ANDROID."
10102 PRINT :PRINT :PRINT
10103 PRINT "YOU DO NOT HAVE TO PRESS RETURN, JUST THE ROW NUMBER,"
10104 PRINT "OR THE NUMBER OF ANDROIDS YOU WISH TO HAVE REMOVED."
10105 PRINT "IF YOU WISH TO GIVE UP, PRESS THE R KEY."
10106 PRINT :PRINT
10110 PRINT :INPUT "PUSH RETURN WHEN READY & WAIT A BIT";DUMMY$
10120 RETURN
20000 INKEY$= ""
20010 IF PEEK (33278)= 0THEN RETURN
20020 INKEY$= CHR$ (PEEK (33278))
20030 POKE 33278,0
20040 RETURN
21000 READ ZA,ZB,ZC,ZD,ZE,ZF
21010 IP$= CHR$ (ZA)+ CHR$ (ZB)+ CHR$ (ZC)+ CHR$ (ZD)+ CHR$ (ZE)+ CHR$ (ZF)
21020 RETURN