Coup à revoir en mots et avancement de l'analyse du bilan
Le coup à revoir se dit en mots, lus sur les demi-coups du moteur, puis la notation entre parenthèses (phrases revoir.…). summaryProgress donne « 14 coups sur 24 » pour la place réservée du bilan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
7d7beeafe0
commit
83621dd61c
@@ -18,8 +18,9 @@ import {
|
||||
replayPoint,
|
||||
runAnalysis,
|
||||
summarizeAnalysis,
|
||||
summaryProgress,
|
||||
} from "../../src/domain/analysis/game-analysis.js";
|
||||
import { diceWords, summaryReading } from "../../src/domain/analysis/phrases.js";
|
||||
import { diceWords, reviewSentences, summaryReading } from "../../src/domain/analysis/phrases.js";
|
||||
import type { Engine } from "../../src/domain/game/engine.js";
|
||||
import type { GameJournal } from "../../src/domain/game/events.js";
|
||||
import { Game } from "../../src/domain/game/game.js";
|
||||
@@ -27,6 +28,7 @@ import { parseHalfMoves } from "../../src/domain/game/position.js";
|
||||
import { fixedDice } from "../../src/domain/game/roll.js";
|
||||
import { memoryStorage, openGameLibrary } from "../../src/storage/open-library.js";
|
||||
import { createReviewRunner } from "../../src/ui/review-runner.js";
|
||||
import { REVIEW_TEXTS } from "../../src/ui/review-texts.js";
|
||||
import { loadPhrases } from "../support/advice.js";
|
||||
import { loadNodeEngine } from "../support/node-engine.js";
|
||||
|
||||
@@ -158,6 +160,35 @@ Then("le maître y aurait joué {}", (move: string) => {
|
||||
assert.equal(advice?.skill, "veryBad");
|
||||
});
|
||||
|
||||
/** « Le maître analyse la partie : 2 coups sur 2. » d'un journal. */
|
||||
function progressLine(journal: GameJournal): string {
|
||||
const progress = summaryProgress(journal);
|
||||
return REVIEW_TEXTS.analysingProgress(progress.done, progress.total);
|
||||
}
|
||||
|
||||
Then(/^avant l'analyse, le bilan dit « (.+) »$/, (text: string) => {
|
||||
assert.equal(progressLine(game.journal), text);
|
||||
});
|
||||
|
||||
Then(/^après l'analyse, « (.+) »$/, (text: string) => {
|
||||
assert.equal(progressLine(analysed), text);
|
||||
});
|
||||
|
||||
/** Le coup à revoir en mots (étape 1m). */
|
||||
function reviewed() {
|
||||
const advice = summarizeAnalysis(analysed).toReview?.advice;
|
||||
assert.ok(advice?.kind === "move");
|
||||
return reviewSentences(phrases, advice);
|
||||
}
|
||||
|
||||
Then(/^le bilan le dit en mots : « (.+) »$/, (text: string) => {
|
||||
assert.equal(reviewed().played, text);
|
||||
});
|
||||
|
||||
Then(/^il ajoute « (.+) »$/, (text: string) => {
|
||||
assert.equal(reviewed().master, text);
|
||||
});
|
||||
|
||||
Then("la courbe de vos chances de gagner finit à {int} %", (percent: number) => {
|
||||
const curve = chanceCurve(analysed);
|
||||
assert.equal(curve.length, gameTurns(analysed).length);
|
||||
|
||||
Reference in New Issue
Block a user