jump backwards

This commit is contained in:
cjdenio committed 2026-09-11 14:25:51 -05:00
1 parent 6a83b1c263
commit e6798b1a67
4 files changed
+1 -4

No files matched your search

-1
View File
@@ -6,5 +6,4 @@ todo
- reveal grid/word - reveal grid/word
- .puz checksums - .puz checksums
- fix shift+enter / short+tab in other terminals - fix shift+enter / short+tab in other terminals
- after entering letter, jump to next unfilled cell (even if it's backwards)
- clear grid - clear grid
+1 -1
View File
@@ -380,7 +380,7 @@ func (state *State) HandleInput(buffer []byte) (exited bool) {
if !cellWasFilled { if !cellWasFilled {
// jump to next unfilled cell in clue // jump to next unfilled cell in clue
for x := i + 1; x < len(state.SelectedClue.Cells); x++ { for x := (i + 1) % len(state.SelectedClue.Cells); x != i; x = ((x + 1) % len(state.SelectedClue.Cells)) {
if state.PuzzleState[state.SelectedClue.Cells[x]] == '-' { if state.PuzzleState[state.SelectedClue.Cells[x]] == '-' {
state.SelectedCell = state.SelectedClue.Cells[x] state.SelectedCell = state.SelectedClue.Cells[x]
break break
-1
View File
@@ -103,7 +103,6 @@ func main() {
} }
state.SelectedClue = nil state.SelectedClue = nil
state.SelectedCell = -1 state.SelectedCell = -1
state.Goodbye = true
fmt.Printf("\r\x1b[%dA", uiHeight) fmt.Printf("\r\x1b[%dA", uiHeight)
fmt.Print("\x1b[J") fmt.Print("\x1b[J")
state.RenderUI(os.Stdout) state.RenderUI(os.Stdout)
-1
View File
@@ -66,7 +66,6 @@ func main() {
if exited { if exited {
state.SelectedClue = nil state.SelectedClue = nil
state.SelectedCell = -1 state.SelectedCell = -1
state.Goodbye = true
fmt.Fprintf(s, "\r\x1b[%dA", uiHeight) fmt.Fprintf(s, "\r\x1b[%dA", uiHeight)
fmt.Fprint(s, "\x1b[J") fmt.Fprint(s, "\x1b[J")
state.RenderUI(s) state.RenderUI(s)