check word

This commit is contained in:
cjdenio committed 2026-09-24 15:36:49 -06:00
1 parent 176c3997cd
commit 5d62a4b611
3 files changed
+17 -2

No files matched your search

+2 -2
View File
@@ -1,6 +1,6 @@
all: bin/crossword bin/crossword-ssh
bin/crossword: main.go puz/puz.go game/game.go
go build -o $@ .
bin/crossword: cmd/main.go puz/puz.go game/game.go
go build -o $@ ./cmd
bin/crossword-ssh: ssh/main.go puz/puz.go game/game.go
go build -o $@ ./ssh
View File
File renamed without changes.
+15
View File
@@ -226,6 +226,21 @@ func (state *State) CheckPuzzle() {
state.CheckState = result
}
func (state *State) CheckWord(clue *puz.Clue) {
for i, cellIdx := range clue.Cells {
cellState := state.PuzzleState[cellIdx]
if cellState == '-' || cellState == '.' {
continue
}
if cellState == rune(clue.Solution[i]) {
state.CheckState[cellIdx] = 'y'
} else {
state.CheckState[cellIdx] = 'n'
}
}
}
func (state *State) RenderUI(w io.Writer) int {
uiHeight := 0