This is a version of the set of scripts that we use to verify CodeCombat tournaments.
It's really messy, but it managed to correctly simulate over 150,000 CodeCombat games in less than 45 minutes. Maybe I'll clean it up one day (perhaps before the next tournament.)