Files
ballpit/Readme.md

1018 B

Ballpit

Version: 1.0.19362.1

Created By: Jali jali@orca-central.de

Last Modified By: jali@orca-central.de

Overview

The ballpit program is a small command line tool written in Rust. It shows the princible of sorting balls, randomly picked from a ball pit, by their colour.

The algorithm used here, is implemented in a naïve way, to make it as easy as possible for a layman's audience to understand how it works.

Usage

The program is run from the command line. It only takes one option -n or --no-of-balls which is followed by the number of balls to generate inside the pit:

./ballpit -n 10000

Runs the program for a pit with 10000 balls.

The algorithm

The algorithm itself is a very simple and naïve implementation, and it is not a traditional sorting algorithm either. It simply picks a ball from the pit at random, and packs it into one of four buckets, depending on the colour.

Flussdiagram