Learning Languages through Text Adventure Programming

You begin with a ‘Hello World’, then have to build a loop for the main game, and some keyboard handling to take input. The next thing to sort out is string handling, as you begin parsing commands. Simultaneously, you have to learn about the language’s data structures (and possibly object models) as you work to find a way to represent the game world.

Once that’s done, you have a broad sway of options - you could deal with data formats and file IO for saved games, or perhaps introduce a currency, even introduce AI for game characters.

Most importantly, a text adventure gives you the opportunity to quickly see a fun finished product in a new language - you rarely need to use any libraries, which can be a stumbling block with web applications and more complicated games, and the final thing doesn’t even need to be particularly complicated. Just a few locations and puzzles will do.

Recently, I’ve been learning Rust, and I want to learn more about the new features in PHP 7.0 - expect to see a couple of new text adventures posted here soon!