Skip to content

Commit c8e0ff2

Browse files
committed
Renju: Hopefully this fixes the Renju 4-4 issue.
1 parent 189242a commit c8e0ff2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/games/in_a_row/InARowBase.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,9 @@ export abstract class InARowBase extends GameBase {
376376
while (countTotal < this.boardSize) {
377377
const [x1, y1, wrapped] = this.wrap(x + count * sign * dx, y + count * sign * dy);
378378
if (!this.toroidal && wrapped) { break; }
379-
if (!this.board.has(this.coords2algebraic(x1, y1))) {
379+
const cell = this.coords2algebraic(x1, y1);
380+
if (this.board.get(cell) === player % 2 + 1) { break; }
381+
if (!this.board.has(cell)) {
380382
if (this.isFive(x1, y1, dx, dy, player)) { foursCount++; }
381383
break;
382384
}

0 commit comments

Comments
 (0)