mirror of
https://github.com/cjdenio/crossword.git
synced 2026-10-03 11:06:19 +00:00
check word
This commit is contained in:
3 files changed
+17
-2
No files matched your search
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user