Level 9 - Yeeter Swirl
This challenge looks vaguely familiar...
Objective
Follow the swirl being careful not to step on any traps (or get yeeted off the map). Note: The elf.moveTo(object)
function has been disabled for this challenge.
Hint
Use loops and an incrementing count to take the exact number of steps. Some sample code has been started for you but needs to be fixed/finished.
The levers all ask that you pull with a number that is incremented, for example lever0 is pulled with lever.pull(0)
, lever1 is lever.pull(1)
, etc.
Starting code, most of the fun stuff is already completed:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
The Munchkin's challenge
munchkin.ask()
will not be used for my challenge. Instead, create a function that will accept one argument.
For example:
1 2 3 |
|
Your created function will be passed a randomized list
containing list
's which contain str
's and int
's.
For example:
1 2 3 4 5 6 |
|
Your created function must be able to iterate over this randomized list and each of its child list
's and return the total sum of adding all of the int
's in all of the child list
's.
Once you have created this function and are sure it will return the desired sum, pass your created function as an argument to me:
munchkin.answer(YourFunctionNameHere)
If your passed function works properly, I will become friendly and move out of your way.
Solution
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|