CS Unplugged activity
Secret Messages in ASCII
CS Unplugged activity slides Lesson plan (and sub notes)
Computers do not store letters. They store numbers. ASCII is the code that turns each letter into a number, and you are about to crack it.
Your code table
| A | B | C | D | E | F | G | H | I |
|---|---|---|---|---|---|---|---|---|
| 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 |
| J | K | L | M | N | O | P | Q | R |
| 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 |
| S | T | U | V | W | X | Y | Z | space |
| 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 32 |
What to do
- Find each number in the table above.
- Write the matching letter in the box under it.
- A hatched box is the code 32. That means “space.” Leave it blank.
- Read your finished answer to check it makes sense.
Now decode these
1. A computer stores every letter as a ___.
2. Binary only uses two digits: zero and ___.
3. A group of eight bits is called a ___.
4. Fun fact: the first computer bug was a real ___.
Lowercase, punctuation, and digits
Real messages need more than capital letters. Every lowercase letter’s code is 32 more than its capital: A is 65, so a is 97.
| a | b | c | d | e | f | g | h | i |
|---|---|---|---|---|---|---|---|---|
| 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 |
| j | k | l | m | n | o | p | q | r |
| 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 |
| s | t | u | v | w | x | y | z | |
| 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 |
| space | ! | , | . | ? |
|---|---|---|---|---|
| 32 | 33 | 44 | 46 | 63 |
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|---|---|---|---|---|---|---|---|---|---|
| 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 |
Notice that the digit 7 is stored as 55, not 7. To a computer, the character “7” and the number 7 are different things. (That’s why a program that reads typed text has to convert “12” into the number 12 before it can do math with it.)
For example, 72 105 33 is Hi!
Decode this friendly question.
Now with digits. Decode this one.
Write your name in ASCII
Now go the other way. Write one letter of your name in each top box, then use the table to write its code underneath.
Short name? Leave the extra boxes blank. Longer than eight letters? Keep going on the back of the page.
Secret messages for a friend
Think of two short messages (up to 16 letters, spaces, and marks each) and write them on the lines below the fold line. Then write each message’s codes in its boxes, one character per box. Fold the bottom strip under so only the codes show, and trade with a friend. Can they read your messages?
Message 1 codes:
Message 2 codes:
fold here
Message 1:
Message 2:
Your friend’s messages
Decode your friend’s codes, one character in each box.
Friend's message 1:
Friend's message 2:
ASCII table: 32 to 122
Every character from code 32 to 122. Use it for your secret messages.
| Code | Char | Code | Char | Code | Char | Code | Char | Code | Char |
|---|---|---|---|---|---|---|---|---|---|
| 32 | space | 51 | 3 | 70 | F | 89 | Y | 108 | l |
| 33 | ! | 52 | 4 | 71 | G | 90 | Z | 109 | m |
| 34 | " | 53 | 5 | 72 | H | 91 | [ | 110 | n |
| 35 | # | 54 | 6 | 73 | I | 92 | \ | 111 | o |
| 36 | $ | 55 | 7 | 74 | J | 93 | ] | 112 | p |
| 37 | % | 56 | 8 | 75 | K | 94 | ^ | 113 | q |
| 38 | & | 57 | 9 | 76 | L | 95 | _ | 114 | r |
| 39 | ' | 58 | : | 77 | M | 96 | ` | 115 | s |
| 40 | ( | 59 | ; | 78 | N | 97 | a | 116 | t |
| 41 | ) | 60 | < | 79 | O | 98 | b | 117 | u |
| 42 | * | 61 | = | 80 | P | 99 | c | 118 | v |
| 43 | + | 62 | > | 81 | Q | 100 | d | 119 | w |
| 44 | , | 63 | ? | 82 | R | 101 | e | 120 | x |
| 45 | - | 64 | @ | 83 | S | 102 | f | 121 | y |
| 46 | . | 65 | A | 84 | T | 103 | g | 122 | z |
| 47 | / | 66 | B | 85 | U | 104 | h | ||
| 48 | 0 | 67 | C | 86 | V | 105 | i | ||
| 49 | 1 | 68 | D | 87 | W | 106 | j | ||
| 50 | 2 | 69 | E | 88 | X | 107 | k |
Want even more (codes 0 to 127, in hex too)? See the full ASCII / Hex table.
Answer key
- NUMBER
- ONE
- BYTE
- TINY MOTH
Lowercase, punctuation, and digits: Hi, how are you? / I am 12 years old.
Version history
- Loading commit history…