Welcome to the Code Puzzlebox! Solve each puzzle to unlock the next level. Can you make it to the end?
Find the next number in this sequence:
2, 4, 8, 16, 32, ?
This JavaScript function should return the factorial of a number, but it has a bug. Fix the code:
function factorial(n) {
if (n === 0) return 1;
return n - factorial(n - 1);
}
What is the correct operator to replace the "-" in the return statement?
This encoded message contains a password. Decode it by shifting each letter backward by 3 positions in the alphabet:
frgh_flskhu
What is the output of this logic expression?
let a = true;
let b = false;
let c = true;
let result = (a && b) || (c && !b);
This code should check if a string is a palindrome (reads the same forward and backward). What's the missing line?
function isPalindrome(str) {
// Normalize the string: lowercase and remove non-alphanumeric
str = str.toLowerCase().replace(/[^a-z0-9]/g, '');
// MISSING LINE HERE
// Compare the original with its reverse
return str === reversed;
}
What should the missing line be to create the reversed string?
Congratulations! You've solved all the puzzles and unlocked the code puzzlebox.
Secret Code: CODEMASTER2025
Feel free to inspect the source code to see how this puzzlebox was built!