10 PRINT "LAPIDES"
20 REM
25 DIM R(10)
30 PRINT"KNOW THIS GAME(Y OR N);
40 INPUT Q$
50 IF Q$="Y" THEN 70
60 GOSUB 1000
70 RANDOMIZE TIMER
80 PRINT
90 GOSUB 2000
100 GOSUB 3000
110 GOSUB 4000
120 GOSUB 5000
130 GOSUB 6000
140 IF X > 1 THEN 110
150 PRINT "DO IT AGAIN( Y OR N)";
160 INPUT Q$
170 IF Q$="Y" THEN 210
180 PRINT "SO LONG GANG"
190 PRINT "THE END..."   
200 END
210 PRINT "SAME PLAYERS (Y OR N )";
220 INPUT Q$ 
230 IF Q$="Y" THEN 100
240 GOTO 80
1000 PRINT "TWO PLAYERS TAKE A ROCK FROM A "
1010 PRINT "PILE.  THE ONE STUCK WITH THE"
1020 PRINT"LAST ROCK LOSES"
1030 PRINT
1040 PRINT "YOU CAN'T PICK MORE ROCK IN "
1050 PRINT "YOUR TURNE THEN ARE LEFT IN"
1060 PRINT "THE TOP ROW"
1070 PRINT 
1080 PRINT "HERE WE GO...."
1090 RETURN
1999 REM "TYPE NAMES"
2000 PRINT "TWO PLAYER'S NAME:"
2010 PRINT "#1";
2020 INPUT P1$
2030 PRINT "#2";
2040 INPUT P2$
2050 PRINT "OK (Y OR N)";
2055 INPUT Q$
2060 IF Q$="Y" THEN 2080
2070 IF Q$="N" THEN 2000 
2080 IF P1$=" " THEN 2000
2090 IF P2$=" " THEN 2000
2100 IF P1$=P2$ THEN 2000            
2110 P = INT(10*RND(1)) 
2120 IF P=> 5 THEN 2150 
2130 P=1
2140 RETURN
2150 P =2
2160 RETURN
2999 REM "PLIE UP THE ROCKS"
3000 FOR I= 1 TO 9
3010 R(I)=I 
3020 NEXT I
3030 RETURN
3999 REM "PRINT LAPIDES"
4000 FOR I = 1 TO 9
4005 IF R(I)=0 THEN 4050
4010 FOR J=1 TO R(I)
4020 PRINT "*";
4030 NEXT J
4040 PRINT
4050 NEXT I
4060 RETURN
4999 REM "PLAYERS INPUT"
5000 IF P=1 THEN 5040
5010 P=1
5020 PRINT P1$"'S TURN
5030 GOTO 5060
5040 PRINT P2$"'S TURN
5050 P=2
5060 INPUT Q
5070 IF Q <1 THEN 5090
5080 GOTO 5110
5090 PRINT "PLAY FAIR OK !"
5100 GOTO 5060
5110 FOR I=1 TO 9
5120 IF R(I) <> O THEN 5140
5130 NEXT I
5140 IF Q<=R(I) THEN 5170
5150 PRINT "ONLY "R(I)"POSSIBLE"
5160 GOTO 5090
5170 R(I) = R(I)-Q
5180 RETURN
5999 REM "CHECK FOR WIN "
6000 X=0
6010 FOR I=1 TO 9
6020 X=X+R(I)
6030 NEXT I
6040 IF X > 1 THEN 6080
6045 IF X= 0 THEN 6110
6050 PRINT "HA HA, ";
6060 IF P=1 THEN 6090
6070 PRINT P2$ ",WINS"
6080 RETURN
6090 PRINT P1$ ",WINS"
6100 RETURN
6110 PRINT "DUMMY!!"
6120 PRINT "YOU TOOK THE LAST ONE."
6130 RETURN
