Yeah, step functions really break this. I think I was in a game with you or some else with the same general idea, they won on the very first turn with the sine wave trick.
You can just analyze the graphical output of the browser and hence make your hack useless. The underlying problem of this game is just too easy to solve.