Isolation

See all articles from SYNC v2 n2

In Isolation you attempt to encircle one of the computer’s men, isolating him from all of his cohorts. A man is isolated when you have placed one of your men above, below, to the left, to the right and in the four locations diagonally adjacent to the victim. Therefore, a man located in a corner of the playing area requires only three men to be cut off; a man on any other edge position will require five men to be isolated; and for any man located away from the edges you will need eight of your men to surround him. The computer may or may not place a new man on the board on its turn. By adding another man it may thwart your plans, or the man may fall right into your clutches! At the end of the game you receive a point for each of the computer’s men you have isolated from his confreres.

Press RUN and NEWLINE to start the game. One of the Computer’s men (a gray square) will appear on the board. Select a position for your man (a black square) and enter it as follows: letter, number, NEWLINE. When all of the positions on the board have been filled, or, if you enter “0” (zero) to end the game, your score will be displayed.

 10 DIM A(81)
20 LET T = 0
30 LET S = 0
40 FOR I = 1 TO 81
50 IF I < 11 OR I > 71 OR (I / 9) * 9 = I OR
((I - 1) / 9) * 9 = I - 1 THEN LET A(I) = 1
60 NEXT I
70 FOR I = 1 TO 7
80 PRINT CHR$(I + 37);"#";
90 FOR J = 1 TO 7
100 PRINT "+";
110 NEXT J
120 PRINT
130 NEXT I
140 PRINT
150 PRINT "##1234567"
160 LET D = RND(61) + 10
170 IF A(D) > 0 THEN GO TO 160
180 LET A(D) = 2
190 LET Y = D / 9
200 LET X = D - 9 * Y - 1
210 LET M = 9
220 GO SUB 350
230 INPUT Y$
240 LET Y = CODE(Y$) - 37
250 IF Y = -9 THEN GO TO 400
260 LET X = CODE(TL$(Y$)) - 28
270 IF Y > 7 OR X > 7 THEN GO TO 230
280 LET C = 9 * Y + X + 1
290 IF A(C) > 0 THEN GO TO 230
300 LET A(C) = 1
310 LET M = 128
320 GO SUB 350
330 IF RND(3) = 2 THEN GO TO 230
340 GO TO 160
350 LET P = X + 2 + 10 * (Y - 1)
360 POKE PEEK(16396) + 256 * PEEK(16397) + P,M
370 LET T = T + 1
380 IF T = 49 THEN GO TO 400
390 RETURN
400 FOR I = 11 TO 71
410 IF (A(I) = 2 AND A(I - 10) = 1 AND A(I - 9) = 1
AND A(I - 8) = 1 AND A(I - 1) = 1 AND A(I + 1) = 1
AND A(I + 8) = 1 AND A(I + 9) = 1 AND A(I + 10) = 1)
THEN LET S = S + 1
420 NEXT I
430 PRINT "POINTS =#";S
440 STOP

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.