4 ms·
if you force move to be an arithmetic function with inputs the stats of the game, then you can parse that the syntax of the move functions only involve arithme
by mooom 15y ago
if you force move to be an arithmetic function with inputs the stats of the game, then you can parse that the syntax of the move functions only involve arithmetic operators and some math functions (max, min, ...). This way one can't cheat in the game.
- cheald 15y agoMy #move method was perfectly innocuous; I cheated by making my player never take damage, and by giving him infinite stats. Parsing source code for "bad" stuff is generally an arms race you can't win. For actual sandboxing you need a clean environment (hence, the reference to Lua's setfenv).