10 ' **************** TAKE-AWAY ****************
20 '                    BY
30 '                MICHAEL RUF
40 '          AND HIS CHIEF ASSISTANT
50 '                RICK  MACK
60 '
70 DIM E(20)
80 PRINT:PRINT:PRINT:PRINT
90 INPUT "NUMBER OF PLAYERS";PL
100 INPUT "NUMBER OF ROWS";NR
110 IF NR>15 THEN PRINT "MAXIMUM IS 15":GOTO 100
130 E(1)=3:E(2)=5:E(3)=7
150 FOR I=1 TO NR
160 PRINT I;
170 IF I=1 THEN I2=3 ELSE I2=I*2+1
180 FOR I1=1 TO I2
190 PRINT "* ";
200 NEXT I1:PRINT
210 E(I)=I1-1:NEXT I
220 P=1
240 PRINT "ENTER ROW PLAYER " P;
250 INPUT R
260 IF R<1 OR R>NR THEN PRINT "ILLEGAL ROW":FOR W=1 TO 400:NEXT W:GOTO 240
270 INPUT "NUMBER TO TAKE";T
280 IF T>E(R) THEN PRINT "YOU CAN'T TAKE THAT MANY.":FOR W=1 TO 600:NEXT W:GOTO     240
290 IF T=0 THEN PRINT "HEY CHEATER, FORGET IT''":FOR W=1 TO 700:NEXT W:GOTO 240
300 ' EXTRACT ASTREKS
310 PE=E(R)
330 E(R)=PE-T
340 P=P+1:IF P=PL+1 THEN P=1
350 FOR I=1 TO NR:IF E(I)>0 THEN NW=1:NEXT I 
360 IF NW=1 THEN NW=0:GOTO 240
370 IF P=1 THEN P=PL+1
390 PRINT "PLAYER" P-1 " WINS THE GAME.":RUN
400 END
