adapt to updated tools module
This commit is contained in:
parent
7d03482c4a
commit
2a9e391885
10
day18/day.go
10
day18/day.go
@ -4,9 +4,9 @@ import (
|
|||||||
"tools"
|
"tools"
|
||||||
)
|
)
|
||||||
|
|
||||||
func play(grid tools.ToggleGrid, stuckCorners bool) {
|
func play(grid tools.GridToggle, stuckCorners bool) {
|
||||||
neighbours := tools.NewIntGrid()
|
neighbours := tools.NewGridInt()
|
||||||
for thisCoord := range grid.GetCoordinates() {
|
for _, thisCoord := range grid.GetCoordinates() {
|
||||||
for cx := thisCoord.X - 1; cx <= thisCoord.X+1; cx++ {
|
for cx := thisCoord.X - 1; cx <= thisCoord.X+1; cx++ {
|
||||||
for cy := thisCoord.Y - 1; cy <= thisCoord.Y+1; cy++ {
|
for cy := thisCoord.Y - 1; cy <= thisCoord.Y+1; cy++ {
|
||||||
if cy == thisCoord.Y && cx == thisCoord.X {
|
if cy == thisCoord.Y && cx == thisCoord.X {
|
||||||
@ -32,8 +32,8 @@ func play(grid tools.ToggleGrid, stuckCorners bool) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeGridFromInput(input []string) tools.ToggleGrid {
|
func makeGridFromInput(input []string) tools.GridToggle {
|
||||||
grid := tools.NewToogleGrid()
|
grid := tools.NewGridToggle()
|
||||||
for y, line := range input {
|
for y, line := range input {
|
||||||
for x, c := range line {
|
for x, c := range line {
|
||||||
if c == '#' {
|
if c == '#' {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user