Crate sorting_visualization[][src]

sorting-visualization

CI Status

A Rust program for visualizing sorting algorithms which uses Piston for graphics. Inspired by Hopson97/Sort-Algorithm-Visualiser.

Demo

Setup

git clone https://github.com/dmitmel/sorting-visualization
cd sorting-visualization
cargo build --release

Usage

# see 'Features' section for the list of supported algorithms and their IDs
# and use the --help flag to print all available animation options
cargo run <algorithm>
# list all available algorithms
cargo run -- --list

Features

Building docs

./docs.sh

Nightly Rust is required for building docs because it has infra doc link resolution which is currently unstable.

TODO

  1. User-friendly GUI
  2. More algorithms
  3. Sound?

Contributing

Documentation

PRs are appreciated!

License

MIT © Dmytro Meleshko

Modules

algorithms

Different sorting algorithms as well as the general Algorithm trait.

app

The App struct and some constants.

array

The Array struct.

cli

Command-line interface and command-line argument parsing. Uses clap under the hood.

state

Structs and type definitions that describe the app state.

Constants

OPENGL_VERSION

Required version of OpenGL.

WINDOW_SIZE

Initial size of the main window.

WINDOW_TITLE

Title of the main window.

Functions

main
run