Text Based Games

1 Why text games?

Learn It

  • In the early days of computers, graphics were a rare thing.
  • Most users interacted with their computers using a terminal, which was only capable of rendering/displaying text.
  • Because of this, some of the earliest games ever made were purely text-based games, that is all graphics were made of only ASCII characters. If you don't know what ASCII characters are, look at this link ASCII LIST


  • To this day, many programmers still like to create text-based games. This is especially useful when trying out a new language, as it lets the programmer play around with solving problems using the programming language, without having to worry about the complicated world of rendering graphics.
  • Have a go at playing this famous puzzle, and fantasy game Zork.

Badge It - Silver

  • Imagine you were tasked with creating a computer game, but you could only display ASCII characters on the screen and only take ASCII characters as input.
  • Look at this link ASCII LIST
  • Create a list of three types of games that you could create by ONLY using those ASCII characters as either graphics or user inputs. Write a short description for each one of your game.See the example work below for guidance. By the end of this module, you might even be capable of creating one.
My game 1:
   A player (letter P) will be moved around by the user using W.S.A.D keys
   inside a walled area made of letter T.  
   Inside the walled area, there will be 5 chickens (letter X,Y,Z,W,K)
   moving randomly. 
   The goal is for the player to catch all the chickens within a set 
   amount of time. Difficulty levels can be set by the time.

Test It

  • Right click on this link Download this file, and choose to save to your home folder.
  • Double click it to open it up.
  • You might need to resize the terminal on Windows - right click the top bar and choose properties

screen1.png screen2.png

  • This is a very simple (rogue-like) game that you can play. Use the W,A,S,D keys to control your movement (hitting return each time)
  • You can move about the cave, kill monsters (A-G) and heal at shrines (?)

Code It

  • Now open up the file in IDLE (or another text editor)
  • Have a go at changing the layout of the caves in the first string that was declared. Then play the game.

Extension activity

  • Have a read through the code of the game - you don't have to understand it all.
  • Try and change the HitPoints to make the game easier/harder
  • Add an additional monster to the game.
  • Take a screenshot of the functions you changed. Upload to your screenshot to the week1 Gold, then finish the self-assessment below.

Badge It - Gold & Platinum

  • After you have done the above extension tasks, take this self assessment quiz. Please don't forget to upload the screenshot so your teacher can verify that you actaully have done the tasks.