I have written a few small mostly free or open source games over the years:

Still Yet Another Sokoban An open source implementation of the popular puzzle game, in which the goal is to push the crates onto the designated squares without getting stuck.

Falling Blocks A game based on something resembling Tetris(TM) but in no way is it Tetris(TM).

Dave Gnukem A retro-style game that could perhaps be thought of as a parody (albeit not a very funny one) of the famous 1991 DOS classic, Duke Nukem 1. It is open source (C++) and cross-platform. It has a github repo. Download Latest Release »

• Finally, a few really ancient and probably uninteresting things here (simple slider piece puzzle) and here (QBasic stuff ~1990s).