Files
cabrits-math/lib/problems/types.ts
2026-03-01 18:50:29 -04:00

22 lines
520 B
TypeScript

export type Difficulty = 1 | 2 | 3;
export type MathAnswer =
| { kind: "fraction"; numerator: number; denominator: number }
| { kind: "decimal"; value: number }
| { kind: "integer"; value: number }
| { kind: "ratio"; parts: number[] }
| { kind: "standardForm"; coefficient: number; exponent: number };
export interface SolutionStep {
explanation: string;
math?: string;
}
export interface MathProblem {
id: string;
prompt: string;
answer: MathAnswer;
hints: string[];
steps: SolutionStep[];
}