Add new statement and styling

Add "Both of us are knights" statement to the interactive. Update styling for statements and their negations using different border styles and colors to represent A, B, and the statement.
This commit is contained in:
gpt-engineer-app[bot] 2025-08-08 07:10:05 +00:00
parent 44dd1497f6
commit 94eb08f316
2 changed files with 30 additions and 0 deletions

View file

@ -5,6 +5,7 @@ import { cn } from "@/lib/utils";
// Statements
const STATEMENTS = [
{ id: "S", label: "At least one of us is a knave." },
{ id: "SNEG", label: "Both of us are knights." },
{ id: "AK", label: "A is a knight" },
{ id: "AN", label: "A is a knave" },
{ id: "BK", label: "B is a knight" },
@ -13,6 +14,15 @@ const STATEMENTS = [
type StatementId = typeof STATEMENTS[number]["id"];
const META: Record<StatementId, { group: "A" | "B" | "S"; neg: boolean }> = {
S: { group: "S", neg: false },
SNEG: { group: "S", neg: true },
AK: { group: "A", neg: false },
AN: { group: "A", neg: true },
BK: { group: "B", neg: false },
BN: { group: "B", neg: true },
};
const KnightsAndKnavesI = () => {
const [inArena, setInArena] = useState<StatementId[]>([]);
const [showExplain, setShowExplain] = useState(false);
@ -80,6 +90,7 @@ const KnightsAndKnavesI = () => {
if (ids.has("AN") && aKnight) continue;
if (ids.has("BK") && !bKnight) continue;
if (ids.has("BN") && bKnight) continue;
if (ids.has("SNEG") && !(aKnight && bKnight)) continue;
// A's utterance if included: S = "At least one is a knave"
if (ids.has("S")) {