Domaine : abandon proposé, accepté ou refusé (événements version 3)
Trois événements d'abandon et le champ resigned de GameEnded, migration des versions 1 et 2 testée ; points selon le videau, score et Crawford du match par le moteur ; export SGF à la manière de gnubg (RE[W+4R]), relu par gnubg de bureau. Phrases abandon.refus et abandon.accepte, fiche Abandon, scénarios Gherkin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
e98497e5b1
commit
de32811bba
@@ -111,6 +111,44 @@ async function main(): Promise<void> {
|
||||
games.push(["setup-unfinished", game]);
|
||||
}
|
||||
|
||||
// Abandons (étape 1k), depuis la position de référence
|
||||
// « resign-gammon-likely » : en partie libre, videau à 2 chez
|
||||
// l'ordinateur, le simple refusé, quelques coups, puis le gammon
|
||||
// accepté s'il l'est encore (sinon la partie reste en cours) ; dans un
|
||||
// match en 7 points, le gammon accepté d'entrée.
|
||||
{
|
||||
const game = Game.start(engine, {
|
||||
dice: seededDice(19),
|
||||
level: "0ply",
|
||||
setup: {
|
||||
position: "sp2DBwDgOfgAaA",
|
||||
firstTurn: "player",
|
||||
cube: { value: 2, owner: "computer" },
|
||||
},
|
||||
});
|
||||
await game.resign("single");
|
||||
await game.resign("gammon");
|
||||
games.push(["resign-free", game]);
|
||||
}
|
||||
{
|
||||
const game = Game.start(engine, {
|
||||
dice: seededDice(23),
|
||||
level: "0ply",
|
||||
setup: { position: "sp2DBwDgOfgAaA", firstTurn: "player" },
|
||||
match: { length: 7, score: { player: 0, computer: 0 }, crawford: false },
|
||||
});
|
||||
await game.resign("single");
|
||||
await playMoves(game, engine, 2);
|
||||
if (game.state.phase === "rolling" && game.state.turn === "player") {
|
||||
const choices = await game.resignOptions();
|
||||
const last = choices.at(-1);
|
||||
if (last !== undefined) {
|
||||
await game.resign(last.kind);
|
||||
}
|
||||
}
|
||||
games.push(["resign-match", game]);
|
||||
}
|
||||
|
||||
let files = 0;
|
||||
for (const [name, game] of games) {
|
||||
const original = game.journal;
|
||||
|
||||
Reference in New Issue
Block a user