kripke: add stats (2)

This commit is contained in:
2025-09-24 20:27:57 +09:00
parent 3edaed9327
commit 585059aa32

View File

@@ -5,6 +5,7 @@ import * as Dialog from "$lib/components/ui/dialog";
import { import {
type Formula, type Formula,
getFrame, getFrame,
isomorphic,
nontrivials, nontrivials,
tryParse, tryParse,
validWorlds, validWorlds,
@@ -65,7 +66,9 @@ function evaluate() {
const res: number[] = [frames.length]; const res: number[] = [frames.length];
for (const move of moves) { for (const move of moves) {
if (move.type === "guess") { if (move.type === "guess") {
frames = frames.filter((f) => f.id !== move.frameId); const frameId = isomorphic[move.frameId];
if (move.correct) frames = [{ id: frameId, frame: getFrame(frameId) }];
else frames = frames.filter((f) => f.id !== frameId);
} }
if (move.type === "check") { if (move.type === "check") {
if (move.valid < 0 || move.valid > 4) return undefined; if (move.valid < 0 || move.valid > 4) return undefined;