We have Alan Turing to thank for all the computers we see around us. He is the father of modern computer science: he created the idea of a programmable machine long before computers were even built.

Download a pdf of the instructions here.

The code game is reasonably simple to play, but the codes may be very hard to decipher without a little help.

You may like to tell them they can only use one type of code (a substitution code for example - type B) above.  Or that they need to tell the other team the type of code they are using.  Hopefully they will have to have written enough dow in their notes that their code can be cracked when all the papers are exchanged.  Make sure they don't cheat by throwing anything 'overboard'.  Apparently the code books for the enigma machine were all written in water soluble ink so they could be easily destroyed!

Scottish Curriculum Links:



MNU 4-03a

Number, money and measure - Number and number processes


MTH 3-12a

Number, money and measure - Mathematics - its impact on the world, past, present and future

I have worked with others to research a famous mathematician and the work they are known for, or investigated a mathematical topic, and have prepared and delivered a short presentation.


MTH 4-12a

Number, money and measure - Mathematics - its impact on the world, past, present and future

I have discussed the importance of mathematics the real world, investigated the mathematical skills required for different career paths and delivered, with others, a presentation on how mathematics can be applied in the workplace.


MTH 3-13a

Number, money and measure - Patterns and relationships

Having explored number sequences, I can establish the set of numbers generated by a given rule and determine a rule for a given sequence, expressing it using appropriate notation


MTH 4-13a

Number, money and measure - Patterns and relationships

Having explored how real-life situations can be modelled by number patterns, I can establish a number sequence to represent a physical or pictorial pattern and determine a general formula to describe the sequence, then use it to make evaluations and solve related problems.


MNU 3-20a

Information handling - Data and analysis

I can work collaboratively, making appropriate use of technology, to source information presented in a range of ways, interpret what it conveys and discuss whether I believe the information to be robust, vague or misleading.


MNU 4-20a

Information handling - Data and analysis

I can evaluate and interpret raw and graphical data using a variety of methods, comment on relationships I observe within the data and communicate my findings to others.


Codes and code breaking

Alan Turing is famous for working at Bletchley Park during World War II.  His job, along with all the other people who worked there, was to make sense of messages sent by the Germans to each other.  These messages were sent in code, and it was job of the people at Bletchley Park to crack them.

enigma machineOne of the ways the Germans coded their messages was with an enigma machine.  This machine looked very like a typewriter, but it produced a code letter for each letter key that was pressed.  An electric current from each key press would light up a letter behind the keyboard.  On a normal keyboard the key 'G' would light up the letter 'G' behind.  But the wires on the enigma machine didn't go straight from the key to the letter behind it; every time a key was pressed, wheels inside the machine would turn and change the connections between the keyboard and the letters.  So if you pressed the letter 'G' the letter 'S' might light up.

A message could be typed into the keyboard and the machine produced the code - someone just needed to write down which letters lit up as the message was typed in!  The coded message could be sent by Morse code using a radio transmitter to the person waiting to receive it.  To decipher the message, that receiver would need to know all the machine settings when the sender first typed the message.  It didn't matter who was listening in to the radio signals because unless they had an enigma machine with the correct settings they couldn't translate it.  At least, that was true initially!

Morse code

morse codeThis is a universal code, which means anyone will be able to decode it and understand it in the same way.  Morse code works well with many different ways of transmitting a message, not just using a radio.  Can you think of different ways of transmitting a Morse coded message across the room?

The Enigma machine did not produce a universal code.  The idea with the Enigma machine was to scramble the letters as much as possible.  Unlike a simple code where you might change one letter to another, the letter 'A' might code as 'C' the first time it is pressed, but 'Q' the second time.  Enigma did this so well that there were 158 million, million, million ways the code could be set up.  This meant it was potentially very difficult for any unwanted 'listeners' to decode it.

Key Fact: There are many types of codes, and the Enigma machine produced a particularly complex code because it changed constantly.

Enigma had been used before the war and a Polish machine called 'Bomba' had been designed to crack these Enigma codes.  However, Bomba did not work on the new Enigma machines used by the German military.  Alan Turing and Gordon Welshman created a machine based on Bomba which they called 'Bombe', which was more successful.  Bombe acted like 36 Enigma machines all running at the same time.  The human cryptographers at Bletchley Park would make guesses at some of the code because many German Enigma operators gave themselves away by using the same opening or ending phrases.



Download a pdf of the instructions here.

You will need...

A pen

There are many ways to make up codes; the more creative you are, the less likely someone will be able to break the code.  But don't forget that you will want someone else to be able to decipher it, or there is no point in making the code in the first place!  You will need to arrange in advance how the code is created and how the person receiving the message will unscramble it.

Ways of creating codes: some help...

A.  Write down the alphabet and give each letter a number, in sequence: a=1, b=2, c=3, and so on to z=26.  Send your message in the form of numbers... INVIGORATE = 9 14 21 9 7 15 18 1 19 5.  For someone to decode this, you need to tell the person receiving it that you used a simple substitution.

B.  To make the code a little more difficult to break, you can do something similar, but offset the numbers a=5, b=6, and so on to z=30 etc.  INVIGORATE = 13 18 25 13 11 19 22 5 23 9.  To decode the other person needs to know you used a substitution plus 4; perhaps you could add '4' to the start of the code so they know to add this number on to their simple substitution.

C.  A way to make it more difficult is to put the letters of the alphabet in a grid, a 5x5 grid, or 2 x 13 etc.  Read across then down - so H is 3 then 2 = 32.
Using the grid shown here, A=11, B=21, C=31, and INVIGORATE = 42 43 25 42 22 53 34 11 54 51.  You can let the decoder know the type of grid by add 55 to beginning of your message.  Remember you will need to be sure you and your partner write the letters in the same way (i.e. across and then down)!

D.  Have a look online to figure out some other codes.  The more research you do the better your code will be and the more information you will have to help you decipher someone else's code!
Start with this site which has loads of examples of different codes

What to do...

1.  Get into groups of four, and within each group of four, into two pairs.

2.  With the other half of your pair (your ally), work out the type of code you are going to use.  Take some time to work it out.  Make a note of anything you need to decipher the code, but the less you have written down on paper the better!

3.  Now separate and make up a message for each other, using your agreed code.  Write the coded message out twice.  Don't make the message too long - you can start with 3 or 4 words!

4.  Now give your coded message to your ally and accept theirs.  Give the other copy of your coded message to the other pair: to you, they are 'the enemy'!

5.  Take some time to decipher the message from your ally.  Once you have done that, get together with your ally and start working on trying to decipher the two messages you have picked up from the enemy!

6.  You can do some more research to help you decipher your enemy's code...

Has each member of the enemy used the same code?  Do they look similar?
Does it look like they may have used any familiar words?  Hello, goodbye?
Does it look like they might have made some words shorter?

7.  If you can't decipher their code, you will need to capture their information.  The weakness of any code is any written information which will help the person decode it.  Hand over all your written material to the enemy (they have captured your ship!), and receive theirs.  Does this help you decipher the code now?