adapt to updated tools module

This commit is contained in:
Stefan Harmuth 2020-12-30 07:35:29 +01:00
parent 7d03482c4a
commit 2a9e391885

View File

@ -4,9 +4,9 @@ import (
"tools"
)
func play(grid tools.ToggleGrid, stuckCorners bool) {
neighbours := tools.NewIntGrid()
for thisCoord := range grid.GetCoordinates() {
func play(grid tools.GridToggle, stuckCorners bool) {
neighbours := tools.NewGridInt()
for _, thisCoord := range grid.GetCoordinates() {
for cx := thisCoord.X - 1; cx <= thisCoord.X+1; cx++ {
for cy := thisCoord.Y - 1; cy <= thisCoord.Y+1; cy++ {
if cy == thisCoord.Y && cx == thisCoord.X {
@ -32,8 +32,8 @@ func play(grid tools.ToggleGrid, stuckCorners bool) {
}
}
func makeGridFromInput(input []string) tools.ToggleGrid {
grid := tools.NewToogleGrid()
func makeGridFromInput(input []string) tools.GridToggle {
grid := tools.NewGridToggle()
for y, line := range input {
for x, c := range line {
if c == '#' {