Skip to content

Commit d05cac2

Browse files
author
Christopher Field
committed
Fix for valid message issue in Root Bound
1 parent 23def64 commit d05cac2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/games/rootbound.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,6 @@ export class RootBoundGame extends GameBase {
539539
if (moves.includes(m) || (this.stack.length === 2 && cells.length === 1 && m !== "pass")) {
540540
result.valid = true;
541541
result.canrender = true;
542-
result.message = i18next.t("apgames:validation._general.VALID_MOVE");
543542

544543
if ((this.stack.length > 3 && (cells.length === 2 || m === "pass"))
545544
|| (this.stack.length > 1 && cells.length === 2)
@@ -550,6 +549,16 @@ export class RootBoundGame extends GameBase {
550549
} else if (this.stack.length === 2 && cells.length === 1) {
551550
result.complete = -1;
552551
}
552+
553+
if (this.stack.length > 3) {
554+
result.message = i18next.t("apgames:validation.rootbound.INITIAL_INSTRUCTIONS");
555+
} else if (this.stack.length > 2) {
556+
result.message = i18next.t("apgames:validation.rootbound.THIRD_MOVE_INSTRUCTIONS");
557+
} else if (this.stack.length > 1) {
558+
result.message = i18next.t("apgames:validation.rootbound.SECOND_MOVE_INSTRUCTIONS");
559+
} else {
560+
result.message = i18next.t("apgames:validation.rootbound.FIRST_MOVE_INSTRUCTIONS");
561+
}
553562
}
554563

555564
return result;

0 commit comments

Comments
 (0)