The Elf Code: SHHC20
TBD
Intro
 

TBD

Level 1
Level 1
 

Program the elf to the end goal in no more than 2 lines of code and no more than 2 elf commands.

1) elf.moveLeft(10)
2) elf.moveUp(10)
Level 2
Level 2
 

Program the elf to the end goal in no more than 5 lines of code and no more than 5 elf command/function execution statements in your code.

1) elf.moveLeft(6)
2) var answer = elf.get_lever(0) + 2
3) elf.pull_lever(answer)
4) elf.moveLeft(4)
5) elf.moveUp(11)
Level 3
Level 3
 

Program the elf to the end goal in no more than 4 lines of code and no more than 4 elf command/function execution statements in your code.

1) elf.moveTo(lollipop[0])
2) elf.moveTo(lollipop[1])
3) elf.moveTo(lollipop[2])
4) elf.moveUp(1)
Level 4
Level 4
 

Program the elf to the end goal in no more than 7 lines of code and no more than 6 elf command/function execution statements in your code.

1)for (i = 0; i < 6; i++) {
2)  elf.moveLeft(3)
3)  elf.moveUp(11)
4)  elf.moveLeft(3)
5)  elf.moveDown(11)
6)}
Level 5
 

Program the elf to the end goal in no more than 10 lines of code and no more than 5 elf command/function execution statements in your code..

var answer = elf.ask_munch(0).filter(elem => !isNaN(elem)) elf.moveTo(lollipop[1]) elf.moveTo(lollipop[0]) elf.tell_munch(answer) elf.moveUp(2)

Level 6
 

Program the elf to the end goal in no more than 15 lines of code and no more than 7 elf command/function execution statements in your code.

for (i = 0; i < 4; i++) { elf.moveTo(lollipop[i]) } elf.moveTo(lever[0]) answer = elf.get_lever(0) answer.unshift("munchkins rule") elf.pull_lever(answer) elf.moveDown(3) elf.moveLeft(6) elf.moveUp(3)

1)
2)
3)
4)
5)
6)
7)
8)
9)

More shenanigans were had in the Dining Room.

level 7 Program the elf to the end goal in no more than 25 lines of code and no more than 10 elf command/function execution statements in your code. function solveProblem(arg) { for (i = 0; i < cars.length; i++) { text += cars[i] + "
"; } for // some function code will go here return some_desired_data } for (i = 0; i < 7; i++) { elf.moveTo(level[i]) elf.pull_lever[i] } elf.moveRight(8) elf.moveUp(2) elf.moveLeft(4) elf.tell_munch(solveProblem)
×