2023-08-03 21:07:58 +02:00
|
|
|
package maze
|
|
|
|
|
2023-08-04 19:11:26 +02:00
|
|
|
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,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-05 10:38:46 +02:00
|
|
|
type RawMaze struct {
|
|
|
|
PathChar, WallChar byte
|
|
|
|
Data []string
|
|
|
|
}
|
|
|
|
|
2023-08-04 19:11:26 +02:00
|
|
|
type Maze struct {
|
|
|
|
Width, Height uint
|
|
|
|
Nodes []*Node
|
2023-08-03 21:07:58 +02:00
|
|
|
}
|
|
|
|
|
2023-08-04 19:11:26 +02:00
|
|
|
type SolvedMaze struct {
|
2023-08-03 21:07:58 +02:00
|
|
|
Maze
|
2023-08-04 19:11:26 +02:00
|
|
|
Solution []*Node
|
2023-08-03 21:07:58 +02:00
|
|
|
}
|