Skip to content

Latest commit

 

History

History
43 lines (33 loc) · 1.97 KB

README.md

File metadata and controls

43 lines (33 loc) · 1.97 KB

Demonstration

Installation

  1. Install JDK 11
  2. Download the ZIP file or clone the git repository
  3. Click on Jalen's Pathfinder.jar

How to Use

  • Left Click on a button in the grid to pick a start point

  • Left Click on another button in the grid to pick an endpoint and start the pathfinder

  • Right Click on a button to add a wall

  • Drag the Grid Size slider to the left to make it smaller or to the right to make it bigger

  • Drag the Delay (in milliseconds) slider to the left to speed up the pathfinder or to the right to slow down tha pathfinder

  • Check the Include Diagonals box to add diagonals in the pathfinder

  • Check the Generate Maze box to generate a random maze

Algorithms

  • A* algorithm to calculate the shortest path

    • Find the cell closest to the end point
    • Add surrounding nodes of that cell for evaluation
    • Construct the path that was found
    • Show Error If No Path Was Found
  • Recursive algorithm to generate a random maze

    • Begin with a empty grid
    • Set the wall sizes to the width and height of our grid
    • Split the maze into fourths with a horizontal wall & vertical wall
    • Add two passages through each side of the horizontal wall & vertical wall
    • Recursively divide each of the four sides of the maze until the width or height of the walls are 2 cells