How shadielfares/assignment1-2aa4 works
Main Components
• Command-Line Interface (CLI) & Input Handling:
• Entry point as the Main class (located in src/main/java/…/mazerunner/Main.java). This component manages command line arguments such as the maze file (-i MAZE_FILE), the path sequence (-p PATH_SEQUENCE), and the optional method flag (-method {tremaux, righthand}).
• Maze Input and File Processing:
• FileController (src/main/java/…/mazerunner/FileController.java) which is responsible for reading the maze file from disk.
• MazeReader (src/main/java/…/mazerunner/MazeReader.java) which processes the file content and translates it into an internal representation.
• Maze Representation:
• MazeArray (src/main/java/…/mazerunner/MazeArray.java). This component stores the maze’s structure (walls and passages) read from the file.
• Path Computation Logic:
• Direction (src/main/java/…/mazerunner/Direction.java): likely manages the orientation.
• PathTraversal and its interface iPathTraversal (src/main/java/…/mazerunner/PathTraversal.java and src/main/java/…/mazerunner/iPathTraversal.java): these modules carry out the actual traversal logic through the maze.
• PathSequence (src/main/java/…/mazerunner/PathSequence.java): possibly deals with generating a canonical sequence
• PathChecker (src/main/java/…/mazerunner/PathChecker.java): which validates if a provided (or computed) path is correct.
• Output:
• The computed or verified path is printed on the console (standard output). Although not a separate module, it is a key result in the workflow.
Relationships and Data Flow
• The FileController sends the raw file content to MazeReader, which converts it into a MazeArray (internal representation of the maze).
• The MazeRunner (or the main logic in Main) then invokes the PathTraversal (or the designated method: right-hand default or Tremaux if flagged) and uses Direction and PathSequence to compute the path.
• Optionally, if a path is provided via the -p argument, the Main class uses PathChecker to validate the provided sequence against the maze from MazeArray.
• Finally, the result (computed path or verification result such as “correct path”/”incorrect path”) is pushed to the console.
Architectural and Design Patterns
• Separation of Concerns: Notice how file I/O, maze parsing, path computation, and output verification are handled in distinct modules.
• Interface-based Design: The use of an interface (iPathTraversal) for the traversal logic allows different algorithm implementations (e.g., Tremaux vs. right-hand rule).
Including Technologies & Frameworks
• Maven: Note the presence of a pom.xml; this indicates dependency management and build orchestration.
• Java Standard Library: Emphasize the use of standard Java constructs (no external UI frameworks, as this is console-based) and maybe logging with log4j2 (src/main/resources/log4j2.xml).