diff --git a/src/main/java/h06/Main.java b/src/main/java/h06/Main.java index 97d1e39..04a0d77 100644 --- a/src/main/java/h06/Main.java +++ b/src/main/java/h06/Main.java @@ -1,8 +1,13 @@ package h06; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; +import h06.problems.MazeSolverRecursive; +import h06.problems.ProblemSolver; +import h06.ui.MazeVisualizer; +import h06.ui.ProblemVisualizer; +import h06.world.DirectionVector; +import h06.world.World; + +import java.awt.Point; /** * Main entry point in executing the program. @@ -14,17 +19,39 @@ public class Main { * * @param args program arguments, currently ignored */ - public static void main(String[] args) throws IOException { - var path = "/home/nyanyan/Downloads/rubrics_H06/rubrics/csv"; // "Gesamt,32,18," - Files.list(Path.of(path)).filter(p -> { - try { - var lines = Files.lines(p).toList(); - var last = lines.get(lines.size() - 1); - var parts = last.split(","); - return parts[2].equals("0") || parts[2].equals("1") || parts[2].equals("2"); - } catch (IOException e) { - throw new RuntimeException(e); - } - }).forEach(System.out::println); + public static void main(String[] args) { + System.out.println("Hello World!"); + + World world = new World(5, 5); + + world.placeWall(0, 0, false); + world.placeWall(0, 1, false); + world.placeWall(0, 2, false); + world.placeWall(0, 3, false); + world.placeWall(1, 3, false); + world.placeWall(1, 4, false); + world.placeWall(2, 0, false); + world.placeWall(3, 1, false); + world.placeWall(3, 3, false); + + world.placeWall(1, 1, true); + world.placeWall(2, 0, true); + world.placeWall(2, 1, true); + world.placeWall(2, 2, true); + world.placeWall(3, 1, true); + world.placeWall(3, 3, true); + world.placeWall(4, 2, true); + + + ProblemVisualizer visualizer = new MazeVisualizer(); + ProblemSolver solver = new MazeSolverRecursive(); + visualizer.init(world); + visualizer.show(); + + Point start = new Point(2, 0); + Point end = new Point(2, 4); + DirectionVector direction = DirectionVector.UP; + + visualizer.run(solver, start, end, direction); } }