Changed the structure of the Maze struct
This commit is contained in:
parent
fb99f77c4f
commit
4e4dde7ba8
30
maze/maze.go
30
maze/maze.go
@ -1,10 +1,30 @@
|
|||||||
package maze
|
package maze
|
||||||
|
|
||||||
type Maze interface {
|
type Coordinates struct {
|
||||||
maze()
|
X, Y int
|
||||||
|
}
|
||||||
|
type Node struct {
|
||||||
|
Coords Coordinates
|
||||||
|
Up, Down *Node
|
||||||
|
Left, Right *Node
|
||||||
}
|
}
|
||||||
|
|
||||||
type SolvedMaze interface {
|
func NewNode(coords Coordinates) *Node {
|
||||||
Maze
|
return &Node{
|
||||||
solvedMaze()
|
Coords: coords,
|
||||||
|
Up: nil,
|
||||||
|
Down: nil,
|
||||||
|
Left: nil,
|
||||||
|
Right: nil,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type Maze struct {
|
||||||
|
Width, Height uint
|
||||||
|
Nodes []*Node
|
||||||
|
}
|
||||||
|
|
||||||
|
type SolvedMaze struct {
|
||||||
|
Maze
|
||||||
|
Solution []*Node
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user