Using these worksheets

Before we start coding: how to use these worksheets.

  • The code is presented for you to type in, one step at a time.
  • Every step builds on the previous one and results in a visible change to the game. The new parts of the code are shown in yellow.
  • Code which you should remove is shown in yellow with a ##DELETE flag.
  • Each step has suggestions for changing things around. You should definitely try at least one of these: the idea is for you to understand the code enough to be able to play around with it. Make it yours.
  • If line numbers are shown next to the code you should not type them in.
  • You don’t have to type the comments (the lines which begin with a #). But they can help you later when you want to understand the code or make changes.
  • You can, of course, copy and paste the code from the worksheet into your program. But I suggest you don’t. The very act of typing code in helps you to understand it (and doesn’t do your typing skills any harm!).