Aaron Reed has a terrific book, "Creating Interactive Fiction with Inform 7" (http://inform7.textories.com) that walks you through building a complete (and fairly sophisticated) text adventure.
Inform 7 is very much a niche programming language, but it's really interesting and unusual, well worth investigating if you want to broaden your horizons. Vaguely Prolog-like, but written in natural language.