We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d1b9c38 commit a80733cCopy full SHA for a80733c
src/games/logger.ts
@@ -712,7 +712,10 @@ export class LoggerGame extends GameBase {
712
const [tx,ty] = graph.algebraic2coords(cell);
713
const bearing = RectGrid.bearing(lx, ly, tx, ty)!;
714
const ray = grid.ray(tx, ty, bearing).map(coord => graph.coords2algebraic(...coord));
715
- const stop = ray.findIndex(c => !this.board.has(c) || (this.board.get(c) !== "L") && (this.board.get(c) !== "X") );
+ let stop = ray.findIndex(c => !this.board.has(c) || (this.board.get(c) !== "L") && (this.board.get(c) !== "X") );
716
+ if (stop === -1) {
717
+ stop = ray.length;
718
+ }
719
const dominos = ray.slice(0, stop);
720
let pts = 0;
721
for (const chop of [cell, ...dominos]) {
0 commit comments