Micro­power

  

Volume 1 · Number 4 · December 1981

Page 32 of 33

880 REM
890 REM ** . . . . . Clear line subroutine . . . . .
900 SCREEN 1,1:GOSUB 930
910 SCREEN 3,1:GOSUB 930
920 SCREEN 2,2:GOSUB 930:RETURN
930 FOR I = 1 TO 4: PRINT " ";:NEXT I
940 RETURN
945 REM
950 REM ** . . . Move a ring subroutine . . .
1000 IF TR(TT,1) = 0 THEN 1030
1010 IF TR(TF,1) > TR(TT,1) THEN 1150
1020 IF TF = TT THEN 1130
1030 MC = MC+1: GOSUB 800
1040 A(TR(TT,0)-1,TT) = A(TR(TF,0),TF)
1050 A(TR(TF,0),TF) = 0
1060 TR(TT,1) = TR(TF,1)
1070 TR(TT,0) = TR(TT,0) -1
1080 TR(TF,0) = TR(TF,0) + 1
1090 TR(TF,1) = A(TR(TF,0),TF)
1100 IF A(10,0) + A(10,1) = 0 THEN 1180
1110 IF A(10,0) + A(10,2) = 0 THEN 1180
1120 GOSUB 1400:RETURN
1130 SCREEN1,1:PRINT "DON’T BE SILLY":RETURN
1150 SCREEN1,1:PRINT "YOU CANNOT PUT LARGER";
1160 PRINT " RINGS OVER SMALLER ONES!":RETURN
1180 PRINT "CONGRATULATIONS, YOU HAVE DONE IT"
1190 PRINT " OPTIMUM 1023 ";
1200 PRINT "YOU RATING IS ";102300/MC;"%"
1210 PRINT " DO YOU WANT ANOTHER GO (Y/N)?";
1220 INPUT IN$
1230 IF LEFT$(IN$,1) = "N" THEN END
1240 IF LEFT$(IN$,1) = "Y" THEN GOTO 40
1250 GOTO 1220
1260 REM
1270 REM ** . . . . . Convert key to number . . . .
1300 IF IN$ = "A" THEN IN=0:RETURN
1310 IF IN$ = "B" THEN IN=1:RETURN
1320 IF IN$ = "C" THEN IN=2:RETURN
1330 IN = -1000:RETURN
1340 REM
1350 REM ** . . . Move ring graphic sub . . .
1400 ZZ = TF:GOSUB 1420: ZZ = TT
1420 IF ZZ = 0 THEN IX = 14
1430 IF ZZ = 1 THEN IX = 42
1440 IF ZZ = 2 THEN IX = 70
1450 FOR JX = TR(ZZ,0)*3 TO TR(ZZ,0)*3+2
1460 FOR J = 1 TO A(TR(TT,0),TT)
1470 IF ZZ = TT THEN 1510
1480 RESET (J + IX,JX+6)
1490 RESET (IX-J,JX+6)
1500 GOTO 1530
1510 SET(J+IX,JX+9)
1520 SET(IX-J,JX+9)
1530 NEXT J
1540 NEXT JX
1550 GOTO 900

Page 32 of 33