From 3f1053ea61a1693c8e9da9be7b4e4d76928f3632 Mon Sep 17 00:00:00 2001 From: Madison Rye Progress Date: Wed, 18 Mar 2026 14:15:38 -0700 Subject: [PATCH] Initialize slices --- state/history.go | 5 ++++- state/state.go | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/state/history.go b/state/history.go index 7c9ea7f..f96bab9 100644 --- a/state/history.go +++ b/state/history.go @@ -68,10 +68,13 @@ func (s *State) historyStart() { p, peek := s.historyPoint(peek) s.sectionSize = p.X s.cellsPerSection = p.Y - s.cells = newField(s.sectionSize * s.cellsPerSection) + s.cells = newField(s.size()) s.sections = newField(s.sectionSize) s.cursor = &Point{0, 0} + s.rowHeaders = make([]header, s.size()) + s.colHeaders = make([]header, s.size()) s.historyIndex = peek + s.score.Blackout = make([]bool, s.size()) } func (s *State) historyInitSection() { diff --git a/state/state.go b/state/state.go index b66c604..ae491b3 100644 --- a/state/state.go +++ b/state/state.go @@ -45,7 +45,10 @@ func New(sectionSize, cellsPerSection int) *State { cells: newField(sectionSize * cellsPerSection), sections: newField(sectionSize), cursor: &Point{0, 0}, + rowHeaders: make([]header, sectionSize*cellsPerSection), + colHeaders: make([]header, sectionSize*cellsPerSection), } + s.score.Blackout = make([]bool, sectionSize*cellsPerSection) s.history = fmt.Sprintf("g(%d,%d)", sectionSize, cellsPerSection) for x := 0; x < sectionSize; x++ { for y := 0; y < sectionSize; y++ {