1e faite : scénario ajusté (l'ordinateur double, vous passez), plan clos

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Pierre MARTIN
2026-11-10 10:41:35 +01:00
co-authored by Claude Opus 5.5
parent 4d6f8cfc2e
commit ced004edb0
4 changed files with 20 additions and 59 deletions
+12 -6
View File
@@ -108,10 +108,17 @@ When(/^vous choisissez (?:cette fois )?le coup (.+)$/, async (move: string) => {
await playMove(move);
});
When("l'ordinateur sort ses deux pions avec {int}-{int}", async (a: number, b: number) => {
dice.push(a, b);
/** L'ordinateur, sûr de sortir ses deux pions au jet suivant, double ; le
* joueur passe. */
async function computerDoublesAndPlayerPasses(): Promise<void> {
await game.playComputerTurn();
assert.equal(game.state.phase, "over", "l'ordinateur a doublé au lieu de jouer");
assert.equal(game.state.phase, "doubled", "l'ordinateur ne double pas");
await game.drop();
assert.equal(game.state.phase, "over");
}
When("l'ordinateur, sûr de gagner, double et que vous passez", async () => {
await computerDoublesAndPlayerPasses();
analysed = await analyse(game.journal);
});
@@ -190,7 +197,7 @@ Then("la partie a deux branches, dont la partie d'origine, intacte", () => {
});
Given("une partie finie enregistrée sans aucune analyse", async () => {
dice = [6, 1, 2, 1];
dice = [6, 1];
game = Game.start(engine, {
setup: { position: BEAROFF, firstTurn: "player" },
level: "2ply",
@@ -198,8 +205,7 @@ Given("une partie finie enregistrée sans aucune analyse", async () => {
});
await game.roll();
await playMove("6/5 5/off");
await game.playComputerTurn();
assert.equal(game.state.phase, "over");
await computerDoublesAndPlayerPasses();
const { library } = await openGameLibrary({ localStorage: memoryStorage() });
await library.save("ancienne", game.journal, { level: "2ply" });
const saved = await library.load("ancienne");