maze-solver-go/maze/maze.go
Karma Riuk fcb2bc0d51 Reader -> Reader+Parser refacfotring: create the
parser package, moved the parsing aspect of reader
to parser (still have some naughty stuff like
WallChar and PathChar in parser but it'll be fixed
in next commit)
2023-08-05 10:38:46 +02:00

36 lines
472 B
Go

package maze
type Coordinates struct {
X, Y int
}
type Node struct {
Coords Coordinates
Up, Down *Node
Left, Right *Node
}
func NewNode(coords Coordinates) *Node {
return &Node{
Coords: coords,
Up: nil,
Down: nil,
Left: nil,
Right: nil,
}
}
type RawMaze struct {
PathChar, WallChar byte
Data []string
}
type Maze struct {
Width, Height uint
Nodes []*Node
}
type SolvedMaze struct {
Maze
Solution []*Node
}