Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 1.07 KB

README.md

File metadata and controls

42 lines (28 loc) · 1.07 KB

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

Key Action
Space Shuffle and restart
Esc / close window Quit

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:

Constant Default Description
NUMBER_COUNT 200 Number of elements / target FPS
SCREEN_WIDTH 800 Window width
SCREEN_HEIGHT 600 Window height
LINE_WIDTH 10 Width of each bar in pixels
LINE_HEIGHT_FACTOR 10 Multiplier for bar height