Skip to content

Instantly share code, notes, and snippets.

@mati0090
mati0090 / robot.js
Created December 4, 2012 02:15 — forked from sinbonders/robot.js
DRONE_A2
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
var rotateDir = 'right';
var cloned = 0;
Robot.prototype.onIdle = function(ev) {
{ send_for_approval: "sent for approval",
deactivate: "deactivated",
reactivate: "reactivated",
}.each do |status, desc|
define_method status do
if @offer.send(status)
redirect_to @offer, :notice => "Offer was #{desc}."
else
render :action => "edit"
end