Run the program NEWOTHLO to start a new game and the program OTHELLO to continue a game.
Move with the arrow keys and confirm with EXE. If you can't take a piece, just select an empty place and the turn will go to the other player. If you by mistake select a place that already has a piece you'll get a new try. When you don't have any pieces on the table the game will go on but in reality you've lost of course.
Bugs fixed 19 jan. See bold lines.
Note: Before playing the first time, set the player number (Mat A[3,1]) to anything.
-> means right arrow.
=> means the right arrow in the "jump" menu.
\= means the "not equal to" symbol.
_means the display symbol
File name: NEWOTHLO
{8,8}->Dim Mat D
Fill(0,Mat D)
1->Mat D[4,4]
1->Mat D[5,5]
2->Mat D[4,5]
2->Mat D[5,4]
2->Mat A[5,1]
ClrList
Prog "OTHELLO"
File name: OTHELLO
ViewWindow 1,17,1,1,9,1 Change 17 to the widh of your screen.
CoordOff
GridOn
LabelOff
BG-None
Mat A[3,1]->P
Cls
F-Line 9,9,9,1
Text 3,70,"~OTHELLO~"
Text 26,70,”WAIT... ”
For 1->A To 8
For 1->B To 8
Int 7.7A-3->C
Int 7.7B-3->D
Mat D[A,B]=1=>Text C,D,"O"
Mat D[A,B]=2=>Text C,D,"(star)"
Next
Next
Lbl 1
P->Mat A[3,1]
P=1=>Text 26,70,"WHITE O"
P=2=>Text 26,70,"BLACK (star)"
Plot 5,5_ 9-Int Y->A
Int X->B
B>8=>Goto 1
Mat D[A,B]\=0=>Goto 1
Text 26,70,”WAIT... ”
Lbl A
B=8=>Goto C
1->Z
0->M
1->N
Goto 2
Lbl B
A=8 Or B=8=>Goto C
2->Z
1->M~N
Goto 2
Lbl C
A=8=>Goto E
3->Z
1->M
0->N
Goto 2
Lbl D
A=8 Or B=1=>Goto E
4->Z
1->M
-1->N
Goto 2
Lbl E
B=1=>Goto G
5->Z
0->M
-1->N
Goto 2
Lbl F
A=1 Or B=1=>Goto G
6->Z
-1->M~N
Goto 2
Lbl G
A=1=>Goto 9
7->Z
-1->M
0->N
Goto 2
Lbl H
A=1 Or B=8=>Goto 9
8->Z
-1->M
1->N
Lbl 2
A+M->C
B+N->D
A->E
B->F
While C>1 And C<8 And D>1 And D<8 And Mat D[C,D]\=0 And Mat D[C,D]\=P
C+M->C
D+N->D
WhileEnd
If Mat D[C,D]\=0 And (Abs (C-E)>1 Or Abs (D-F)>1)
Then While C\=E Or D\=F
P->Mat D[E,F]
Int 7.7E-3->G
Int 7.7F-3->H
P=1=>Text G,H,"O"
P=2=>Text G,H,"(star)"
E+M->E
F+N->N
WhileEnd
IfEnd
Z=1=>Goto B
Z=2=>Goto C
Z=3=>Goto D
Z=4=>Goto E
Z=5=>Goto F
Z=6=>Goto G
Z=7=>Goto H
Lbl 9
P=1=>2->Q
P=2=>1->Q
Q->P
Goto 1