feat: rudamentary guess interface

This commit is contained in:
2026-08-20 12:24:23 +02:00
parent ffc5b9d38e
commit 90ccd230e4
2 changed files with 11 additions and 6 deletions
+10 -6
View File
@@ -1,10 +1,14 @@
import { Solver } from "wordle-solver";
import { Color, Solver } from "wordle-solver";
const button = document.getElementById("my-button")!;
const txt = document.getElementById("out")!;
const button = document.getElementById("my-button")! as HTMLButtonElement;
const out = document.getElementById("out")! as HTMLTextAreaElement;
const guess = document.getElementById("guess")! as HTMLInputElement;
var s: Solver = Solver.new();
out.innerText = s.stats();
button.addEventListener("click", () => {
var s = Solver.new();
txt.innerText = s.stats();
s.free();
let val = guess.value;
s.guess(val, Array.from({ length: val.length }, () => Color.GREY ));
out.innerText = s.stats();
});