This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A bot for this silly demo: http://www.webdeveloperjuice.com/demos/jquery/snake_jquery.html | |
// Compile with http://closure-compiler.appspot.com/home set to Advanced Optimization | |
// | |
// Automatically runs when compiled statement is pasted into console. Type "win()" to run it again. | |
(window['win'] = function () { | |
// direction mappings | |
var i, dirs = ['up', 'right', 'down', 'left'], | |
diffs = [[-1, 0], [0, 1], [1, 0], [0, -1]]; // don't ask me why the coords are ordered [y,x] | |
window['t'] = 1; // next Turn direction if we hit a wall (opposite of last turn direction) | |
window['m'] = 1; // My internally tracked direction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# put your username and password here | |
USERNAME = "" | |
PASSWORD = "" | |
import urllib, urllib2, cookielib, json, sys, datetime | |
from optparse import OptionParser | |
# handle command line arguments |