Skip to content

Instantly share code, notes, and snippets.

//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
robot.id = 'frgm4';
};
Robot.prototype.onIdle = function(ev) {
var robot;
robot = ev.robot;
robot.ahead(100);
@adrianmiranda
adrianmiranda / jquery.preload.js
Created July 5, 2012 03:38 — forked from mathiasbynens/jquery.preload.js
JavaScript preload() function
/*!
* $.preload() function for jQuery – http://mths.be/preload
* Preload images, CSS and JavaScript files without executing them
* Script by Stoyan Stefanov – http://www.phpied.com/preload-cssjavascript-without-execution/
* Slightly rewritten by Mathias Bynens – http://mathiasbynens.be/
* Note that since this script relies on jQuery, the preloading process will not start until jQuery has finished loading.
*/
jQuery.preload = function(array) {
var length = array.length,