## Common codes and techniques used in puzzles

There are some codes that you will see come up again and again in Escape Rooms and Puzzle Hunts. They're all fairly simple to use, but can be presented in ways that can make them difficult to spot. In Escape Rooms you'll nearly always be given some kind of reference or hint towards the code, but in most Puzzle Hunts there is more emphasis on working it out yourself.

There are plenty of tools and references online to help you with these codes. We've not linked to any here, but you should be able to find them easily using your favourite search engine.

### Letters to numbers

Let's start with the basics! If we say that `A` equals `1`, `B` equals `2` and so on we can suddenly write text as numbers. So for example, `hello` becomes `8 5 12 12 15`. If you ever find yourself with numbers that are all between 1 and 26, you should try converting them to letters.

This is often called an a1z26 cipher. It's very common as a final step in puzzle hunts, where the main part of the puzzle produces numbers, and you then have to convert them to letters. Sometimes deciding which numbers to convert is a puzzle in itself, though!

### Morse code

Morse code is a way of converting letters into a series of short and long tones, commonly called "dits" and "dahs". In text form, short tones are represented by `.` and long tones by `-`. For example the letter `S` in morse is four dits: `....` while an `O` is three dahs: `---`, so to send out an SOS signal you combine these together: `.... --- ....`. Fun fact: the default notification on old Nokia phones when you received a text message was the morse code for "SMS": `.... -- ....`!

While morse code has a distinctive sound, it's quite easy for puzzles to hide morse code visually. Dahs are three times the length of dits, so if you find yourself with a set of groups that are either 1 or 3 long, Morse code is a good guess. It also naturally appears when you have items that can be categorised as long or short.

### Braille

Braille is a system for writing text using raised bumps that can be read tactilely instead of by sight. These bumps are arranged into grids consisting of two columns of three rows (although very occasionally a fourth row is used) — seeing something in that arrangement is good hint to think about Braille! For example, `Y` in Braille is — you can see it uses five of the six bumps.

One interesting aspect of Braille is that it uses the same set of bumps for letters and digits: `A` doubles as `1`, `B` as `2` through to `J` as `0`. Sometimes the special formatting mark is used to indicate a number follows, but other times you'll just need to figure that out yourself.

### Semaphore

Flag Semaphore is a system for communicating over long distances by holding two flags in certain positions. It was widely used for ship-to-ship communication prior to the widespread adoption of radios. Semaphore flags are normally red and yellow, but when found in puzzles they will rarely be so obvious — there probably won't be any flags at all! Instead, keep an eye out for anything that can be interpreted as pairs of angles.

Like with Braille, the first nine letters can also be interpreted as numbers. There's a slight difference, though: Flag Semaphore uses `K` to represent `0`, and instead `J` is used to signal a return to letters. Similarly, the easiest way to decode Semaphore tends to be by hand.

### Pigpen

Pigpen is a system for writing text that uses two grids split into 9 areas, and two diamonds split into 4. The letters are inserted alphabetically, so an `A` is in the top-left cell of the first grid, which is represented simply by the internal borders of the grid: `┛`; `E` sits in the middle so is surrounded on all sides: `□`; and `I` is in the bottom-right so is the opposite of `A`: `┏`. The next nine letters go into the second grid, and are distinguished with a dot in the center of the cell. The final eight go clockwise in the two diamonds: first without a dot, then with a dot.

Pigpen is common in Escape Rooms, and if you remember the placement order you can decode it fairly easily before you find the key. It's also occasionally used in Puzzle Hunts as it can be hidden within an image in interesting ways.

### Only using certain letters

Have a look at this sentence: `all new solvers want easy results`. There's an answer hidden in plain sight: the first letter of each word spells out `ANSWER`! Another variation on this theme is taking only letters that are capitalised, or bolded, or have some other indicator.

A more advanced version of this that is used extremely often in Puzzle Hunts is called indexing. Indexing is where you have some text and a number, and you use the number to decide which character to take. For example if you had `3 queens, 1 groom` you could take the 3rd letter of "queens" and the 1st letter of "groom" to get `EG`. When indexing, you generally skip over spaces and other punctuation as though they're not there.

If you're having to index into things, the easiest way to handle it is to put your data into a spreadsheet and use the `MID` function to select the letter for you. That way if you realise you need to change the text or the number (or both) the result will automatically update.

### Airport codes and other properties

Lots of things in the real world have 'codes' associated with them. Airports have IATA codes: Heathrow airport in London is `LHR`, for example. Countries have ISO-3166 codes: the United Kingdom is `GB`. There are codes for currencies (`GBP` for the British Pound), UK train stations (`KGX` for Kings Cross), health problems (`W59.22XA` for "Struck by turtle, initial encounter"), and many more. If you look up information about anything during a puzzle keep an eye out for any standardised code that might be associated with it, and if your puzzle has some odd letters or numbers you don't recognise, try searching for them.

It's not just codes, though! Think about an episode of a TV show: it will have a writer, a director, a title, a season number, and an episode number. Sometimes the thing you need to discover will be hinted (but maybe not in an obvious manner); in harder puzzles you might just need to search through a number of properties before something stands out.

### Alternative number formats

When we deal with numbers, we usually use base 10, e.g. `42`. We can represent the same number in other bases easily, though: `101010` in binary (base 2), `222` in base 4, `2A` in hex (base 16), and so on. The smaller bases are often used to hide information: if you have things that have two different states you can encode them to binary; if you have groups of three you might be looking at ternary (base 3), etc.

Changing the base isn't the only way to obfuscate numbers, though. Roman numerals are an Escape Room favourite: `XLII`. Then there are tally marks: `𝍸𝍸𝍸𝍸𝍸𝍸𝍸𝍸𝍷𝍷` in the Western style, or `𝍬𝍢` in rod numerals, among many others. There are also numerous historical systems for writing numbers, such as Egyptian Hieroglyphs, Cistercian Numerals and so on.

### ASCII codes

ASCII is a standard for how computers represent text as numbers. It's a bit more complicated than the A1Z26 encoding, but not by much. Standard ASCII encoding ranges from `0` to `127`. The bits we are mostly interested in are: `32` (space), `48-57` (digits 0-9), `65-90` (A-Z uppercase), and `97-122` (a-z in lowercase). If you see numbers in those ranges, think ASCII!

One interesting property of ASCII is that if you express it in binary, the first bit will always be 0 (because ASCII doesn't use numbers above 127). That means if you have a long string of binary you can quickly check the 1st, 9th, 17th, etc, bits and if they're all 0 you know it's potentially ASCII. Another interesting property is that lowercase and uppercase characters have the same value except for the 3rd bit (which is `1` for lowercase and `0` for uppercase).

There are other computer text encodings such as Unicode, but ASCII is far more commonly used in Puzzle Hunts.