Skip to content

A visual implementation of the A* algorithm, using Python and Processing

License

Notifications You must be signed in to change notification settings

Arthur2479/A-star

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project

A basic visual implementation of the A* algorithm, using Python and the Processing language.

During the solving

To run the program, you need to install Processing (I'm using version 4.2) and run it from its IDE.
I sadly couldn't get Processing to export an executable file, maybe it will be fixed in the future.

How to play

Start the program

After opening the folder in Processing's IDE, click on play.
A 800x800 window should appear, and the algorithm will immediately start searching for the end point.

Interact with the game

There are a few ways you can interact with the simulation:

  • Mouse buttons: (Tip: you can keep them pressed and move your mouse)

    • Left: add blocks
    • Center: move the end point
    • Right: remove blocks
  • Keyboard keys:

    • P: pause the current simulation
    • R: restart the current simulation
    • N: Go to next simulation

Game steps

Start During End
Beginning During the solving Found the path
A random map is generated. The pathfinder starts at the top right The pathfinder uses A* to find the best path. In blue is its current path, in red explored tiles and in green are the potential tiles to explore next The pathfinder found the optimal path ! Its displayed in blue. The programs wait for a bit and starts over

About

A visual implementation of the A* algorithm, using Python and Processing

Topics

Resources

License

Stars

Watchers

Forks

Languages