PUPILS in Blackburn re-invented themselves as code-breakers when they got their hands on a machine which helped defeat the Nazis.

Pleckgate High School Mathematics and Computing College, in Pleckgate Road, welcomed one of only three remaining Enigma machines.

Enigma expert and school liaison officer Claire Ellis, from Cambridge University, was invited to demonstrate how the machine works, and how maths can be applied in the outside world.

The machines, which resemble old-fashioned typewriters, were used by the Germans during the Second World War to send encrypted messages.

But British military intelligence famously cracked the code and accessed the Nazi's secret messages, which many believed signalled an early end to the war.

The pupils heard that if a letter was pressed, the movable parts of the machine would shift, so next time the same letter was pressed, another letter of the alphabet would appear.

Coupled with the fact different parts of the machine could be set up in different ways, Enigma could put a message into code in more than 150 million million million different ways.

As well as hearing about the country's successful use of maths in the past, the 120 pupils from Years 7 and 9 heard how British intelligence still operates a code-breaking department at Government Communication Headquarters (GCHQ), in Cheltenham.

The pupils also formed workshops to try to become code-breakers themselves.

Maths teacher Judy Mallam said the aim of the day was to show that maths is "not all about text books".

She added: "By having a go at cracking the codes, it gave them an example of how maths is applied in real life and, as Claire told them, most people who go on to get maths qualifications are not employed in banks, but in exciting jobs like code-breaking at GCHQ.

"The pupils were absolutely engrossed during the day."