Hands-On Intro to Programming
Python Edition

George Ferguson

Summer 2020
(Updated weblink Summer 2022)

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License
Creative Commons License

Our Goal

Create a computer program that lets us play a simple (very simple) text-based game.

In one hour.

With no prior programming experience!

We can do it!

Our Tools

We will use the Python programming language:

Guess the Number

The computer picks a number between 1 and 10. The user tries to guess the number. That’s it. That’s the game.

I know. It’s not as much fun as Fortnite or 2K.

Extensions to the basic game:

We may get to some of these, you can work on the others or come up with your own ideas between our first and our second meetings.

Other Games

Games like Guess the Number are called “TTY” games because they used to be played on a teletype console attached to a computer. There are lots of other TTY games that you can program using just basic programming skills. Here are a few suggestions:

For some of these it might help to know how to use lists in Python. That’s covered in my Intro to Programming (Python Edition) tutorial.

Another great source of ideas is BASIC Computer Games, edited by David H. Ahl and first published in 1978. The programs are written in BASIC, which is harder to understand than Python (despite its name). But the descriptions of the games are what you want anyway.

Happy programming!