AIM: To design an application, with an effectively efficient mechanism which takes the start and end points on a two-dimensional grid having black blocks represent the obstacles that has to be overcomed inorder to obtain the shortest possible path from start point to the end point on the grid.
Preferred environment: VS code along with python and its extension
To install
python, click here
To install
and set up
VS code for python programing environment, click here
STEP 1. Download the src file.
STEP 2. Run this command on the terminal to install pygame module pip install pygame
STEP 3. Now, run the code file on the terminal using the command python astar.py
STEP 4. A plan white 700X700 grid appears. Choose your start point (orange) followed by the end point (turquoise) anywhere on the grid and then select the blocks to build the barrier (black). Use left click to select and right click to unselect.
STEP 5. Hit the spacebar to run the algorithm to obtain the best possible optimal path.
STEP 6. Click OK
when the message dialogue box appears and enter the button C to clear the screen and repeat from STEP 4 again or QUIT
.
@TechwithTim