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). 8.3 8 create your own encoding codehs answers
Iteration 2 : Evaluates 'i'. It matches the char == 'i' condition. The character is replaced with "!" . encoded_result becomes "H!" . Mastery Guide: 8
Which programming language are you using? (, JavaScript Karel , or Python ) The character is replaced with "
// 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.
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.