3 ms·
Google's "secret" adventure game uses the same trick of hijacking the REPL. The game is meant to be played in the debug console, and you can by defining verbs a
by olooney 8y ago
Google's "secret" adventure game uses the same trick of hijacking the REPL. The game is meant to be played in the debug console, and you can by defining verbs as top level variable names on the global "window" objects the developer made it so that the user can simply type their commands into the debug console.
https://www.theverge.com/2018/10/1/17922628/google-text-adventure-easter-egg-console https://www.theverge.com/2018/10/1/17922628/google-text-adve...
As a side-effect, every possible command, even solutions to puzzles, show up in the global namespace (the "window" object.) Therefore, to prevent cheating (including inadvertent cheating through autocomplete) the developer added a large number of "wrong" answers to the puzzles to the global namespace as well.