Forgot to put the width and height of the maze

when I parsed it, oops (and now it's tested)
This commit is contained in:
Karma Riuk
2023-08-07 18:22:04 +02:00
parent 58787dc4af
commit 92ba1b48e4
3 changed files with 19 additions and 2 deletions

View File

@ -8,13 +8,18 @@ import (
func Parse(reader reader.Reader) (*maze.Maze, error) {
nodesByCoord := make(map[maze.Coordinates]*maze.Node)
ret := &maze.Maze{}
raw_maze, err := reader.Read()
if err != nil {
return nil, err
}
ret := &maze.Maze{
Width: raw_maze.Width,
Height: raw_maze.Height,
Nodes: []*maze.Node{},
}
y := 0
// Parse first line to get entrance
for x := 0; x < raw_maze.Width-1; x++ {