Blyx Nest Blyx language
Registry / Library
library · v0.1.1

Ring Occupancy

Count occupied slots in a one-empty-slot circular queue with wrapped read and write cursors.

Source repository · Package JSON

Use Ring Occupancy

use vendor::ring_occupancy::ring_occupancy;

Run the example

nest demo ring_occupancy@0.1.1
blyxc native-run ring_occupancy-demo/main.blyx
Example source and expected output
use vendor::ring_occupancy::ring_occupancy;

fn main() {
    println!(ring_occupancy(6,2,8));
}

Expected output

4

Published versions

VersionPackageSource commitSHA-256
0.1.1Download ZIP · Browse filesf417ec28b8a851a25713c43c9ddc782817d1c68331a4909f3b2fa329358198727537f964de
0.1.0Download ZIP · Browse files6349f237847188905f6d13486dfe578b356f5a254de8df0769622fea2dd76aec6ea2779c19