untrusted
untrusted copied to clipboard
Level 16: Intentional that the RNG is overrideable?
As in: https://gist.github.com/anonymous/95de74cfda01836e6635
I disallowed #125 and #127, but I think this one is clever enough that we'll keep it :smile:
Hey this is my solution: https://gist.github.com/anonymous/9a5ccee7956df5f01697
It's more brute, is it TOO 'clever'? The methods of map/player (map.getWidth(), for example) is not changeable, I see no reason that global object/method can be overwrote
More worse, it affect ALL levels later. Say, if you write "Math.random=()=>0;" in level 2, then when playing all later levels, this function will always returns 0.
Math.random = function(){return 1} will disarm the boss in the bossLevel. Intentional?
More worse, it affect ALL levels later. Say, if you write "Math.random=()=>0;" in level 2, then when playing all later levels, this function will always returns 0.
The ability to make state persist across levels is clearly a bug that should be fixed.
#442 made changes to Math.random no longer affect all levels. It didn't change the ability to override the RNG in one level. (my inclination is that this is a bug in level 20 but not in level 16)