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,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
type Maze struct {
|
2023-08-07 18:22:04 +02:00
|
|
|
Width, Height int
|
2023-08-04 19:11:26 +02:00
|
|
|
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
|
|
|
}
|