Terminal Games

2025 | repo

As the name suggests, Terminal Games is a collection of small games that are played in the terminal. They are:

The games also inspired the creation of the leaderboards API that is hosted on this website at /leaderboards. This is a simple HTTP server written in C using libmicrohttpd. Supported games use libcurl to access the API and fetch scores from the server's sqlite database, or to post highscores to the leaderboard after the player finishes playing.

In addition, I've created a few small shared libraries to factor out some logic that is common to multiple games (for example, functions for conveniently accessing the leaderboards API live contained in lib/libleaderboard.a). This is deliberate over-engineering of otherwise very simple microgames, just as a fun/toy exercise!

All code is written "from scratch" and available at the project's repo, which also includes instructions on building the games.

Games

Pong

The first game project, a Pong-like game. The major purpose of this game was to get up to speed with ncurses. Secondarily, the game's "physics" and "rendering" are decoupled, as they would be in a larger-scale game or modern game engine; again, over-engineering for fun!

Keepaway

A small game where the player has to prevent a "monster" from reaching a target location by placing barricades to impede the monster's path. A simple exercise in graph data structures and basic pathfinding.

Snake

Very simple Snake clone. The game itself is unremarkable (except perhaps that is uses some interesting bit-packing mechanisms for collision detection); the inspiration for the game was simply to create a new game that would interface with the leaderboards API, which was developed in parallel.