The Elf C0de⚓︎
Elf: Ribb Bonbowford
Direct link: elfcode website
Objective: Operate the Santavator
Request⚓︎
Ribb Bonbowford
Hello - my name is Ribb Bonbowford. Nice to meet you!
Are you new to programming? It's a handy skill for anyone in cyber security.
This challenge centers around JavaScript. Take a look at this intro and see how far it gets you!
Ready to move beyond elf
commands? Don't be afraid to mix in native JavaScript.
Trying to extract only numbers from an array? Have you tried to filter
?
Maybe you need to enumerate an object's keys and then filter?
Getting hung up on number of lines? Maybe try to minify your code.
Is there a way to push
array items to the beginning of an array? Hmm...
Hints⚓︎
Adding to Arrays
var array = [2, 3, 4]; array.push(1)
doesn't do QUITE what was intended...
Getting a Key Name
In JavaScript you can enumerate an object's keys using keys
, and filter the array using filter
.
Filtering Items
There's got to be a way to filter
for specific typeof
items in an array. Maybe the typeof
operator could also be useful?
Compressing JS
There are lots of ways to make your code shorter, but the number of elf commands is key.
JavaScript Primer
Want to learn a useful language? JavaScript is a great place to start! You can also test out your code using a JavaScript playground.
JavaScript Loops
Did you try the JavaScript primer? There's a great section on looping.
Solution⚓︎
Only the first 6 levels count towards solving the challenge. Bonus levels 7 and 8 are not required (but a lot of fun). Some of the scripts include additional empty lines to enhance readability, but all solutions still fit within the maximum line requirements.
Main levels
Level 1
1 2 |
|
Level 2
1 2 3 4 5 |
|
Level 3
1 2 3 4 |
|
Level 4
1 2 3 4 5 6 |
|
Level 5
1 2 3 4 5 6 7 8 9 10 |
|
Level 6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Bonus levels
Level 7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
Level 8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
Response⚓︎
Ribb Bonbowford
Wow - are you a JavaScript developer? Great work!
Hey, you know, you might use your JavaScript and HTTP manipulation skills to take a crack at bypassing the Santavator's S4.