From 130deb40d83058295888c84f1670bf2a9d43bbef Mon Sep 17 00:00:00 2001 From: Karma Riuk Date: Sat, 5 Aug 2023 12:01:29 +0200 Subject: [PATCH] Reader -> Reader+Parser refactoring: main.go now uses the new structure --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 5d9f8b2..fc67d42 100644 --- a/main.go +++ b/main.go @@ -3,21 +3,21 @@ package main import ( "maze-solver/io/reader" "maze-solver/io/writer" + "maze-solver/maze/parser" "maze-solver/solver" "maze-solver/utils" ) func main() { - input := "filename" output := "filename" - reader := &reader.TextReader{PathChar: ' ', WallChar: '#'} + reader := &reader.TextReader{Filename: "filename", PathChar: ' ', WallChar: '#'} writer := &writer.ImageWriter{} solver := &solver.Bfs{} - maze, err := reader.Read(input) - utils.Check(err, "Couldn't read maze from %q", input) + maze, err := parser.Parse(reader) + utils.Check(err, "Couldn't read maze from %q", reader.Filename) solved := solver.Solve(maze) err = writer.Write(output, solved)