8.3 8 Create Your Own Encoding Codehs: Answers !free!
Services de valorisations des mandats immobilier
Photographies, visites virtuelles, plans 2D et 3D pour les professionnels de l'immobilier
8.3 8 Create Your Own Encoding Codehs: Answers !free!
8.3 & 8: Create Your Own Encoding — CodeHS Answers
8) Longer example
Plaintext: "CS IS FUN."
- Using two-digit A=01 mapping with 27=space, 28=period:
- C→03, S→19, space→27, I→09, S→19, space→27, F→06, U→21, N→14, .→28
- Encoded: 03192709192706211428
- Decoding follows the Decode pseudocode above.
Overview
This lesson asks students to design an encoding scheme to convert text into numeric (or other) representations and provide the corresponding decoding process. Below are sample answers and explanations covering multiple reasonable encoding approaches, sample encodings for the phrase "HELLO" and for a longer example, plus pseudocode for encoding and decoding.
2) Simple numeric mapping (A1, B2…)
- Encoding rule: Map letters A–Z → 01–26 (two digits per letter). Use 27 for space, 28 for period, 29 for comma.
- Example: "HELLO"
- H → 08
- E → 05
- L → 12
- L → 12
- O → 15
- Encoded string: 0805121215
- Decoding rule: Read encoded string in two-digit blocks; map 01→A … 26→Z; 27→space, etc.
Explanation of Key Code Choices
-
Token separation with spaces: The encoding uses spaces between tokens (e.g.,
U8 U5). This makes decoding predictable—you split on spaces and map back. Without spaces, decoding would be ambiguous (U8vsUand8). -
Uppercase prefix: Using
Udistinguishes uppercase numbers from lowercase numbers. Without it,A(1) would be indistinguishable froma(1). This is a common trap. -
chr()andord(): These built-in functions convert between characters and their ASCII values. They allow us to generateatozwithout typing each letter. -
Two dictionaries: Separating encoding and decoding logic makes the code cleaner. The
build_decoding_dictfunction reverses the encoding dictionary.
Run the main function
if name == "main": main()
Expected Output Example:
Original: Hello World Encoded: U8 U5 U12 U12 O15 _ U23 O15 U18 U12 U4 Decoded: Hello World
Test original: CodeHS 8.3.8 is fun! Test encoded: C O U4 U5 U8 U19 _ 8 . 3 . 8 _ U9 U19 _ U6 U21 U14 ! Test decoded: CodeHS 8.3.8 is fun!8.3 8 create your own encoding codehs answers
8.3.8 — Create Your Own Encoding (CodeHS): A Practical, Engaging Guide
How to Adapt This to the CodeHS Environment:
-
Review the Specifics: Make sure to check the problem statement for any specific requirements or restrictions.
-
Use the Provided Editor: CodeHS usually provides an editor where you can write your code. Ensure your functions are correctly named and follow any specified output formats.
-
Test Your Code: CodeHS often has an automatic testing system. Use it to test your code and make adjustments as necessary.
If you're still having trouble, consider reaching out to your teacher or classmates for more specific guidance tailored to your assignment's requirements.
The Secret Code Society
It was a typical Wednesday afternoon when 12-year-old Max stumbled upon an intriguing puzzle in his CodeHS class. The assignment was to create their own encoding scheme, and Max was determined to crack the code. Using two-digit A=01 mapping with 27=space, 28=period:
As he worked on his encoding project, Max began to think about the possibilities of secret messages and codes. He had always been fascinated by cryptography and the art of hiding messages in plain sight.
Max's best friend, Emma, was also working on the same project. She had come up with a clever idea to use a combination of letters and numbers to encode messages. Max was impressed and asked if he could take a look at her code.
As they worked together, they started to chat about their favorite encryption techniques. Emma mentioned that she loved the Caesar Cipher, where each letter is shifted by a fixed number of positions in the alphabet. Max shared his fascination with the Vigenère cipher, which used a series of Caesar ciphers based on the letters of a keyword.
Their conversation sparked an idea. What if they combined their techniques to create an even more complex encoding scheme? They started brainstorming and experimenting, trying out different combinations of letters and numbers.
After several trial and errors, they came up with their own encoding scheme, which they dubbed "Max-Emma Code." It was a hybrid of the Caesar Cipher and the Vigenère cipher, with an added twist of using emojis to represent certain letters.
The Max-Emma Code was born, and they couldn't wait to test it out. They wrote a secret message to each other, encoded it using their new scheme, and exchanged the coded messages.
Max was thrilled to see that his message, "HELLO," was transformed into 🌞GURUB😊. Emma was equally excited to decode the message and reveal the hidden text. If you're still having trouble
As they continued to work on their encoding project, Max and Emma realized that they had stumbled upon something much bigger than just a school assignment. They had created a secret language, one that only they could understand.
Their friendship grew stronger as they explored the world of cryptography together. They started a secret code society, where they and their friends could share and decode messages using the Max-Emma Code.
The society became a fun and exciting way for them to communicate with each other, sharing jokes, stories, and secrets in a way that was both thrilling and secure.
Max and Emma had never imagined that a simple school project would lead to the creation of a secret code society. But as they looked back on their journey, they knew that the real magic was not just in the code itself, but in the friendships and adventures that it had brought them.
The End
The CodeHS 8.3.8 Create Your Own Encoding activity requires designing a 5-bit binary representation to map 27 characters, specifically the English alphabet and a space. A valid solution assigns a unique 5-bit code to each letter (e.g., A=00000, B=00001) to meet the minimum bit requirement. For further community discussion and tips, see the conversation on Reddit.