Writing a bot that wins.
Then the game will quickly move on to writing the best bot to defeat other bots;)
If you load these scripts in an iframe with a different domain, subdomain, port or protocol, the same origin policy will prevent these scripts from reading the contents of the main page.
And you can establish a string connection between these iframe and the main page through window.postMessage for a modern browser or using window.name hack for older browsers.
And to prevent theft of cookies, you can have a secret key on your main page, which you send back to your server for each request.
source share