Skip to content

Example Programs

The examples/ directory contains runnable demos intended for manual exploration rather than CI coverage.

If SDL2 is available at configure time, you can run:

Terminal window
./build/kelvra run examples/window_open.kel
./build/kelvra run examples/window_events.kel
./build/kelvra run examples/flappy_bird.kel

These demonstrate visible window creation, event polling, rendering, and simple real-time game logic through the official window package.

The Flappy Bird demo also breaks cleanly into reusable modules under examples/game/flappy/, which makes it a good candidate for future documentation walkthroughs about modules, game-state structs, and package use.

The tests/ tree also acts as a dense catalog of language behavior. It includes focused .kel files for:

  • control flow
  • imports
  • closures
  • optimizations
  • type errors
  • package validation
  • tooling behavior

When documenting a feature, this directory is often the best source of stable examples because it already captures edge cases under automated coverage.