From 0ff76d6dff0fca39875870da665dc5e475ced77a Mon Sep 17 00:00:00 2001 From: Karma Riuk Date: Fri, 4 Aug 2023 19:11:26 +0200 Subject: [PATCH] Changed the structure of the Maze struct --- maze/maze.go | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/maze/maze.go b/maze/maze.go index 47bcd9d..471e361 100644 --- a/maze/maze.go +++ b/maze/maze.go @@ -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 }