Level 15 (exceptionalCrossing.js)?
I'm stuck on Level 15 of Untrusted.
I've gotten this far with no actual knowledge of Javascript beyond knowing C and assuming things are the same. I see no possible solution to this puzzle without some trick of the language I don't know about- no matter what I put in there, player.killedBy() is going to be called, and the Professor is going to die.
Any hints?
Best Answer
Actually you can pass the level without throwing any exception, just hacking the code:
[line 32] player.killedBy('
');},'onCollision':function(player){map.getWidth(
);
Just replacing the "onCollision" action again with a function that doesn't do anything.
Then you can walk on water!!
Pictures about "Level 15 (exceptionalCrossing.js)?"



Puzzle 15 in 5 minutes - JavaScript - 5minsofcode.com
More answers regarding level 15 (exceptionalCrossing.js)?
Answer 2
Of course, the hint is in the name.
You've got to throw an exception.
Answer 3
I like this way:
player.killedBy(function() { throw 'I am Jesus';} ());
Answer 4
also u can use infinite recursion..
player.killedBy((function(){x=function(){x();};x();})());
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Kelly, Artem Podrez, Tim Samuel, FOX

