2023-08-03 21:07:58 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"maze-solver/io/reader"
|
|
|
|
"maze-solver/io/writer"
|
|
|
|
"maze-solver/solver"
|
|
|
|
"maze-solver/utils"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
input := "filename"
|
|
|
|
output := "filename"
|
|
|
|
|
2023-08-04 19:11:00 +02:00
|
|
|
reader := &reader.TextReader{PathChar: ' ', WallChar: '#'}
|
2023-08-03 21:07:58 +02:00
|
|
|
writer := &writer.ImageWriter{}
|
|
|
|
|
|
|
|
solver := &solver.Bfs{}
|
|
|
|
|
|
|
|
maze, err := reader.Read(input)
|
|
|
|
utils.Check(err, "Couldn't read maze from %q", input)
|
|
|
|
|
|
|
|
solved := solver.Solve(maze)
|
|
|
|
err = writer.Write(output, solved)
|
|
|
|
utils.Check(err, "Couldn't write solved maze to %q", output)
|
|
|
|
}
|