Skip to content

Instantly share code, notes, and snippets.

struct Claim {
id: u32,
x: usize,
y: usize,
width: usize,
height: usize,
}
fn read_claims() -> Vec<Claim> {
let input_file = File::open("src/day_3/input.txt").expect("file not found");
@ghusse
ghusse / robot.js
Created December 10, 2012 14:22
Zolmeister
var robots = new Array();
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.start = function( ev ){
@ghusse
ghusse / robot.js
Created December 10, 2012 14:18
Zolmeister
var robots = new Array();
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.start = function( ev ){
@ghusse
ghusse / robot.js
Created December 10, 2012 14:18 — forked from saajuck/robot.js
SAATOR II
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
@ghusse
ghusse / robot.js
Created December 10, 2012 12:54 — forked from joseleme/robot.js
Simple Wall Robot
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
robot.turnGunRight(90);
robot.clone();
this.direction = 1;
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(1);
if (robot.parentId) {
@ghusse
ghusse / robot.js
Created December 8, 2012 13:38
Roborator
var scans = 4,
scansDegrees = 10,
scanIncrements = 5;
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
if (robot.availableClones > 0){
robot.clone();