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
@@ -1,6 +1,6 @@
|
|||||||
all: bin/crossword bin/crossword-ssh
|
all: bin/crossword bin/crossword-ssh
|
||||||
|
|
||||||
bin/crossword: main.go puz/puz.go game/game.go
|
bin/crossword: cmd/main.go puz/puz.go game/game.go
|
||||||
go build -o $@ .
|
go build -o $@ ./cmd
|
||||||
bin/crossword-ssh: ssh/main.go puz/puz.go game/game.go
|
bin/crossword-ssh: ssh/main.go puz/puz.go game/game.go
|
||||||
go build -o $@ ./ssh
|
go build -o $@ ./ssh
|
||||||
File renamed without changes.
@@ -226,6 +226,21 @@ func (state *State) CheckPuzzle() {
|
|||||||
state.CheckState = result
|
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 {
|
func (state *State) RenderUI(w io.Writer) int {
|
||||||
uiHeight := 0
|
uiHeight := 0
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user