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]) }