Maintain history; use state

This commit is contained in:
Madison Rye Progress
2025-09-13 20:58:36 -07:00
parent bef9cd248e
commit f3b3803535
7 changed files with 63 additions and 12 deletions

27
model.go Normal file
View File

@ -0,0 +1,27 @@
package main
import "git.makyo.dev/makyo/gogogogogram/state"
type model struct {
fieldSize, sectionSize, cellsPerSection int
state *state.State
clears, score, factor, track int
columnStates, rowStates [][]int
columnsCorrect, rowsCorrect []bool
history string
}
func newModel(sectionSize, cellsPerSection int) model {
m := model{
fieldSize: sectionSize * cellsPerSection,
sectionSize: sectionSize,
cellsPerSection: cellsPerSection,
state: state.New(sectionSize, cellsPerSection),
}
return m
}