Skip to content

Commit

Permalink
accidently removed main code
Browse files Browse the repository at this point in the history
  • Loading branch information
zentox committed Dec 21, 2023
1 parent 4961805 commit 0a40a5e
Showing 1 changed file with 42 additions and 15 deletions.
57 changes: 42 additions & 15 deletions src/main/java/h06/Main.java
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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);
}
}

0 comments on commit 0a40a5e

Please sign in to comment.