Skip to content

liraymond04/olc-dijkstra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

olc-dijkstra

GUI implementation of Dijkstra's shortest path algorithm in the olcPixelGameEngine.

dijkstra

Controls

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

Building is based on Moros1138's pge-template-project CMake files

Arch Linux

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.sh

You can run the application using the built executable

./build/olc-dijkstra

Windows

Install a C++ compiler like MinGW

Generate project makefiles with CMake

cmake . -G "MinGW Makefiles"

And build the project

mingw32-make

Web build with Emscripten

Web builds use Emscripten, and need the following additional packages:

sudo pacman -S --needed emscripten

Build by passing in a new target flag to the build script

## Optionally pass the -d flag to build for debug
./build.sh -t web

You can run the application by opening a local web server with emrun

emrun build/olc-dijkstra.html

Packages

 
 
 

Contributors