Title – FLIP
System –Sinclair ZX-81
Author – Honório Lisboa Neto
Publication – Micro Sistemas September 1983
Page Scans – 1 2
Preserved By – fusca
Recommended Emulator – EightyOne
Translated Article:
Flip (English word that means something like turn inside out), also known as Othello or Einstein – somewhat serious names for it – it’s a game to be played by two people. It was developed in a TK-85 with 16 Kb of memory.
Flip basically is a strategy game, where luck is not the predominant factor. Players aim to reach the end of the game with a higher number of pieces than their opponent, and this is achieved through appropriate positioning that creates traps and defenses. The basic rules are simple, but they allow very interesting situations, where well-developed reasoning will be a factor of supremacy in the development of the game.
RULES OF THE GAME
The game begins with the screen shown in Figure 1. The starting player must place one of their pieces to trap one or more of the opponent’s pieces, which then become theirs.
This capture is accomplished by placing a piece so that the opponent’s pieces are limited by two of their pieces. The capture can be made in any horizontal, vertical, and even diagonal direction. It is possible to capture in more than one direction with a single piece. There cannot be empty spaces or your own pieces between the pieces to be captured.
Every move must capture at least one enemy piece. A piece placed in a position that does not capture an opposing piece is considered an invalid move. When this occurs, the player does not lose their turn; they are entitled to play again, this time in a valid position.
Let’s look at some examples of valid and invalid moves. Consider the board shown below as a specific moment in a game. (See Figure 2).
Assuming it’s the black piece’s turn to move, the following would be:
– Valid moves:
• D1 – captures the piece on D2
• G2 – captures the pieces on D5, E4, F3, and G3
• H3 – captures the pieces on F3 and G3
• E7 – captures the pieces on E4, E5, and E6
– Invalid moves:
• E8 – there is an empty square on E7
• F7 – there is no piece on C4 to close the diagonal
• B5 – there is an empty square on F5
After RUN and NEW LINE, the board will be empty and the question NAME OF THE PLAYERS? will appear on the screen. The order in which the names are entered will decide who starts the game. However, the start is not decisive; both players have an equal chance of winning.
The program then places the pieces in their starting positions (as seen in Figure 1) and indicates whose turn it is.
Moves should be made by indicating the position each piece will occupy on the board. This position is indicated by the letters and numbers surrounding the board, forming the coordinates of the square to be occupied (similar to those in Battleship). You must first type the letter, then the number, and then NEW LINE. For example: C 4 NEW LINE. Once the move is made, the computer takes charge of capturing. After a move, each player’s number of pieces is updated, and the name of the next player to move appears.
If a player is unable to play (i.e., when there is no place where they can capture at least one of the opponent’s pieces), they must type 0 and NEW LINE, passing the turn to the other player.
At the end of the game, the name of the winner and the total number of pieces for each player will be displayed.
Program line 510, which contains the SLOW instruction, allows you to view captures as they are made. If after a few games you’ve mastered the capture mechanism and find the computer is running too slowly, this line can be omitted; the computer will then operate at FAST (line 6).
Finally, here are some tips for better positioning during games:
– Avoid placing pieces in rows 2 and 7, and in columns B and G;
– Try to place your pieces on the edges and especially in the corners of the board, as a corner will never have its piece captured.
Code:
2 REM ** FLIP **
4 REM ** HONORIO LISBOA NETO-JUN/83 **
6 FAST
10 LET C$=”\##\##”
20 FOR N=2 TO 14 STEP 4
30 FOR M=2 TO 14 STEP 4
40 PRINT AT N,M;C$;AT N+1,M;C$;AT N+2,M+2,C$;AT N+3,M+2;C$
50 NEXT M
60 NEXT N
70 FOR N=1 TO 18
80 PRINT AT 1,N;”\::”;AT 18,N;”\::”
90 NEXT N
100 FOR M=2 TO 18
110 PRINT AT M,1;”\::”;AT M,18;”\::”
120 NEXT M
130 FOR M=2 TO 16 STEP 2
140 PRINT AT 0,M;CHR$ (38+(M-2)/2);AT 19,M;CHR$ (38+(M-2)/2)
150 PRINT AT M,0;CHR$ (29+(M-2)/2);AT M,19;CHR$ (29+(M-2)/2)
160 NEXT M
180 DIM V(2)
190 DIM T(2)
200 DIM S$(4,2)
210 DIM J$(2,10)
220 DIM M(8,8)
230 PRINT AT 21,0;”NOME DOS JOGADORES?”
240 FOR I=1 TO 2
250 INPUT J$(I)
260 IF J$(I,10)<>” ” THEN GOTO 970
270 NEXT I
280 LET S$(1)=”\ .\. ”
290 LET S$(2)=”\ ‘\’ ”
300 LET S$(3)=”\:’\’:”
310 LET S$(4)=”\:.\.:”
320 LET P=0
330 LET V(1)=1
340 LET V(2)=2
350 LET I=2
360 LET X=4
370 LET Y=4
380 GOSUB 1020
390 LET X=5
400 LET Y=5
410 GOSUB 1020
420 LET I=1
430 LET Y=4
440 GOSUB 1020
450 LET X=4
460 LET Y=5
470 GOSUB 1020
480 PRINT AT 9,22;J$(1);AT 10,22;S$(1);AT 13,22;J$(2);AT 14,22;S$(3)
490 PRINT AT 15,22;S$(4);” “;T(2);” “;AT 11,22;S$(2);” “;T(1);” ”
500 IF T(1)+T(2)=64 OR NOT T(1) OR NOT T(2) THEN GOTO 940
510 SLOW
520 PRINT AT 21,0;”AGORA E VOCE “;J$(I)
530 INPUT L$
540 IF L$=”0″ THEN GOTO 910
550 IF LEN L$<>2 THEN GOTO 530
560 LET C=CODE L$(1)-37
570 LET L=CODE L$(2)-28
580 IF L>8 OR L<1 OR C>8 OR C<1 THEN GOTO 870
590 IF M(L,C)>0 THEN GOTO 870
600 LET X=L
610 LET Y=C
620 GOSUB 1020
630 FOR D=1 TO 8
640 LET DX=(D=4)+(D=6)+(D=5)-(D=8)-(D=1)-(D=2)
650 LET DY=(D=2)+(D=3)+(D=4)-(D=6)-(D=7)-(D=8)
660 LET X=L
670 LET Y=C
680 LET X=X+DX
690 LET Y=Y+DY
700 IF X=0 OR X=9 OR Y=0 OR Y=9 THEN GOTO 790
710 IF M(X,Y)=0 THEN GOTO 790
720 IF M(X,Y)<>V(I) THEN GOTO 680
730 LET X=X-DX
740 LET Y=Y-DY
750 IF X=L AND Y=C THEN GOTO 790
760 LET P=1
770 GOSUB 1020
780 GOTO 730
790 NEXT D
800 IF P THEN GOTO 910
810 LET M(L,C)=0
820 LET T(I)=T(I)-1
830 LET R=C+L-INT ((C+L)/2)*2
840 LET C$=” ”
850 IF NOT R THEN LET C$=”\##\##”
860 PRINT AT 2*L,2*C;C$;AT 2*L+1,2*C;C$
870 PRINT AT 21,0;”JOGADA INVALIDA “;J$(I)
880 PAUSE 180
900 GOTO 520
910 LET P=0
920 LET I=(I=2)+2*(I=1)
930 GOTO 490
940 LET I=(T(1)>T(2))+2*(T(1)<T(2))
950 PRINT AT 21,0;”PARABENS “;J$(I);”,VOCE GANHOU”
960 STOP
970 PRINT AT 21,0;”NOME COM 9 LETRAS NO MAXIMO.”
980 PAUSE 300
990 PRINT AT 21,0;” ”
1010 GOTO 250
1020 LET M(X,Y)=V(I)
1030 LET T(I)=T(I)+1
1040 LET IN=(I=2)+2*(I=1)
1050 LET T(IN)=T(IN)-P
1060 IF I=2 THEN LET I=3
1070 PRINT AT 2*X,2*Y;S$(I);AT 2*X+1,2*Y;S$(I+1)
1080 IF I=3 THEN LET I=2
1090 RETURN





