mirror of
https://github.com/onyx-and-iris/aoc2024.git
synced 2025-01-09 22:30:47 +00:00
18 lines
294 B
Go
18 lines
294 B
Go
package two
|
|
|
|
type graph struct {
|
|
data []string
|
|
}
|
|
|
|
func newGraph() *graph {
|
|
return &graph{}
|
|
}
|
|
|
|
func (g *graph) valueAt(p point) rune {
|
|
return rune(g.data[p.y][p.x])
|
|
}
|
|
|
|
func (g *graph) isOutOfBounds(p point) bool {
|
|
return p.x < 0 || p.y < 0 || p.y >= len(g.data) || p.x >= len(g.data[p.y])
|
|
}
|