untrusted icon indicating copy to clipboard operation
untrusted copied to clipboard

Level 16: Intentional that the RNG is overrideable?

Open danfuzz opened this issue 11 years ago • 5 comments

As in: https://gist.github.com/anonymous/95de74cfda01836e6635

danfuzz avatar Apr 11 '14 15:04 danfuzz

I disallowed #125 and #127, but I think this one is clever enough that we'll keep it :smile:

AlexNisnevich avatar Apr 11 '14 18:04 AlexNisnevich

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.

byzod avatar Apr 13 '14 11:04 byzod

Math.random = function(){return 1} will disarm the boss in the bossLevel. Intentional?

MaPePeR avatar Apr 14 '14 12:04 MaPePeR

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.

pppery avatar Jul 18 '19 13:07 pppery

#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)

pppery avatar Jul 23 '19 01:07 pppery