Skip to content

Latest commit

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Sorting Visualizer

A simple sorting algorithm visualizer built with C++ and raylib.

It renders a shuffled array as vertical bars and sorts them step-by-step in real time, so you can watch the algorithm work frame by frame.

Screenshot

Sorting Visualizer

Algorithm

Currently implements Bubble Sort, advancing one comparison per frame.

Controls

KeyAction
SpaceShuffle and restart
Esc / close windowQuit

Building

Requires CMake 3.31+ and a C++ compiler. raylib is fetched automatically via CMake's FetchContent.

cmake -B build
cmake --build build
./build/SortingVisualizer

Configuration

Constants in include/globals.h:

ConstantDefaultDescription
NUMBER_COUNT200Number of elements / target FPS
SCREEN_WIDTH800Window width
SCREEN_HEIGHT600Window height
LINE_WIDTH10Width of each bar in pixels
LINE_HEIGHT_FACTOR10Multiplier for bar height

About

Do you know these sorting algorithm visualizers we see everywhere on instagram? I made my own.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages