Changed the structure of the Maze struct

This commit is contained in:
Karma Riuk 2023-08-04 19:11:26 +02:00
parent fb99f77c4f
commit 4e4dde7ba8

View File

@ -1,10 +1,30 @@
package maze
type Maze interface {
maze()
type Coordinates struct {
X, Y int
}
type Node struct {
Coords Coordinates
Up, Down *Node
Left, Right *Node
}
type SolvedMaze interface {
Maze
solvedMaze()
func NewNode(coords Coordinates) *Node {
return &Node{
Coords: coords,
Up: nil,
Down: nil,
Left: nil,
Right: nil,
}
}
type Maze struct {
Width, Height uint
Nodes []*Node
}
type SolvedMaze struct {
Maze
Solution []*Node
}