Analyse de partie : tours, chance, taux d'erreur à la manière de gnubg, format durable
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
3e7b161933
commit
a657d7d7a9
@@ -19,6 +19,7 @@ import type {
|
||||
EngineCube,
|
||||
EngineMatch,
|
||||
EvaluatedMove,
|
||||
Evaluation,
|
||||
HalfMovesCheck,
|
||||
Level,
|
||||
Luck,
|
||||
@@ -260,6 +261,15 @@ export function createWasmEngine(run: RunCommand): Engine {
|
||||
return { value: answer.luck, rating };
|
||||
},
|
||||
|
||||
async evaluate(position: PositionId, cube: EngineCube, ply: Ply): Promise<Evaluation> {
|
||||
const args = ["--ply", String(ply), "eval", position, await matchId(cube)];
|
||||
const answer = (await run(args)) as {
|
||||
probabilities: { win: number };
|
||||
cubeful_equity: number;
|
||||
};
|
||||
return { win: answer.probabilities.win, equity: answer.cubeful_equity };
|
||||
},
|
||||
|
||||
encodeMatch: matchId,
|
||||
|
||||
async decodeMatch(id: MatchId): Promise<MatchDescription> {
|
||||
|
||||
Reference in New Issue
Block a user