GUI implementation of Dijkstra's shortest path algorithm in the olcPixelGameEngine.
| Button | Action |
|---|---|
| Esc | Quit |
| Shift + Left click | Create node |
| Ctrl + Left click | Move node |
| Left click | Create edge |
| = | Increase edge weight |
| - | Decrease edge weight |
| D + Left click | Delete node/edge |
| S + Left click | Select start node |
| E + Left click | Select end node |
| Enter | Play shortest path |
Building is based on Moros1138's pge-template-project CMake files
Install the required packages with the following command
sudo pacman -Sy base-devel cmake git libpng mesa
Generate project makefiles and build with CMake
# Use the -d flag to build for debugging
./build.shYou can run the application using the built executable
./build/olc-dijkstraInstall a C++ compiler like MinGW
Generate project makefiles with CMake
cmake . -G "MinGW Makefiles"
And build the project
mingw32-make
Web builds use Emscripten, and need the following additional packages:
sudo pacman -S --needed emscriptenBuild by passing in a new target flag to the build script
## Optionally pass the -d flag to build for debug
./build.sh -t webYou can run the application by opening a local web server with emrun
emrun build/olc-dijkstra.html