Simple Stuff in Small Basic


Hi, I am off school today. Here’s what I want you to do. Look at the Prezi embedded below. You should have done everything up to and including the “Simple Maths Test” program. Work through the other tasks on there.

Also,  go onto Project Euler and register.

We have already solved the first two problems, so you can submit those and move on to the third and fourth. There are some notes on the Prezi to help you.

If you get that done, have a go at the “Guess the Number” game that is described in the post before this one.

Guess the Number – a Programming Task


SmallBasic Guess the Number.

Dice Game Small Basic


Exam Question – Dice Game on Prezi

Click the dice to get the basic game code.

Small Basic – getting started


Alan Turing Google Doodle


While researching the first computers, you will have come across the name Alan Turing. He was one of the most important computer scientists ever and helped us to win WWII by breaking the Nazis’ Enigma codes. He committed suicide in 1954. This year is the 100th anniversary of his birth and it is being celebrated as “Alan Turing Year”.

On his birthday in July, there was a Google doodle based on his concept of the “Turing machine”. Click on the image and see if you can solve the puzzles! You have to make the number on the tape match the number in the top right of the window. In solving this puzzle, you are basically writing simple computer programs.

If you get that done and would like to find out more about Alan Turing, here are some useful links.

Here’s the wikipedia entry on Turing.
There is also some good information on the Bletchley Park website and the Alan Turing website.


Monday 15th July


Today, once again there are two options.


The first is a little Scratch game I have created based on Frogger.

This is a really simple game, but it shows some of the basics you might need to know to make a game in Scratch.

First you need to create a background – using a colour for the “water” or “road” in the middle, and a different colour for the safe areas at the top and bottom. To do this, click on the “stage” icon and then choose to edit the background in the middle window.

Your next job is to create a “log”. I just painted a brown rectangle in the built-in editor, but you could use one of the Sprites that comes with Scratch, or make something different. The six “logs” will need a script each, something like this:

This will place the log at the edge of the screen and keep moving it across until it reaches the other size. At that point it is put back at the beginning. I’ll leave it up to you to work out how to get a block to start in the middle and keep looping around.

The “frog” will need a script like this:

This should look simple enough. If you get stuck, let me know and I will give you a bit of help.


If you prefer to work on Python, you can return to the program we we’re looking at last week, if you wish. Alternatively, I have been working on a little program that works out the Caesar Ciphers we were looking two  weeks ago  in class.

It’s a gui program and the output looks like this:

I’m not going to give you all the code this time. You can download part of it here:

I have given you the code to set up the GUI – you’ll see something like this if you run it. What I have taken out is the function “submit()” which takes the input from the text box and encodes or decodes it.

I’d like you to have a go at writing this function. If you get stuck, you can ask me for a bit of help.

Helpful Hint

You’ll probably want to make a list or string with the letters of the alphabet. You can then use a method like “string.find(‘a’)” or “list.index(‘b’)” to give you the position of a certain letter in the string (or list). You can then add or subtract from this number to find the position of the new letter you’ll need.


Happy Hacking


Monday 9th July



Today, I’d like you to do some research into the life of Alan Turing. Last week, in preparation for this, we had a look at the Google Doodle based on a Turing machine and explored some simple cryptography.

A good place to start is the wikipedia entry on Turing.
There is also some good information on the Bletchley Park website and the Alan Turing website.

Have a read and answer the questions on the sheet.



I thought you might like to be able to chat online to each other in this lesson. Have you used swiftirc before? Click the link, pick a nickname and put #9b2 in the “Channel” box. Simples.



Scratch / Bubble Sort

If you complete that, there are a couple of programming exercises you can work on.

The easiest is to learn about Bubble Sort and try out this Scratch version. This will show you one way that computers sort lists of numbers.



Python and Pygame

If you’d prefer to do some Python, here’s a file to download. It’s a very simple starting point for a game. You’ll also need this sound file to be saved in the same folder as the code.

If you look at the code, you’ll see how easy it is to use sound in Python and make keys do things (in this one, we use the arrow keys to move the ball). I’d like you to experiment with modifying this game – for instance you could add some different sounds and make some keys do other things (can you make a key play the sound, for instance).

If you are experimenting with this, you might find the Pygame homepage useful.


Programming Competition
The Raspberry Pi foundation has announced the first of their programming competitions. They especially like games. I wonder if any of you will enter?

happy hacking,