Connect with others who understand.

  • Learn from expert-reviewed resources
  • Real advice from people who’ve been there
  • People who understand what you’re going through
Sign up Log in
Powered By

Mastery Guide: 8.3.8 "Create Your Own Encoding" CodeHS Answers & Walkthrough

A computer doesn't know what "A" looks like; it only knows 01000001 (in ASCII).

Iteration 2 : Evaluates 'i'. It matches the char == 'i' condition. The character is replaced with "!" . encoded_result becomes "H!" .

Which programming language are you using? (, JavaScript Karel , or Python )

// Create a mapping from character to 5-bit code function createCodeMap() { let map = {}; let chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ "; for (let i = 0; i < chars.length; i++) // Convert i to a 5-bit binary string let binary = i.toString(2); // Pad with leading zeros to ensure 5 bits while (binary.length < 5) binary = "0" + binary;

Test decode(encode("Test")) == "Test" after every change.

8.3 8 Create Your Own Encoding Codehs Answers -

Become a member to get even more

See answer