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
//FightCode can only understand your robot | |
//if its class is called robotClass | |
var robotClass = function(){ | |
}; | |
robotClass.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(100); | |
robot.rotateCannon(360); |
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
//FightCode can only understand your robot | |
//if its class is called robotClass | |
var robotClass = function(){ | |
}; | |
robotClass.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(100); | |
robot.rotateCannon(360); |
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
//FightCode can only understand your robot | |
//if its class is called robotClass | |
var robotClass = function(){ | |
}; | |
robotClass.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(100); | |
robot.rotateCannon(360); |
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
//FightCode can only understand your robot | |
//if its class is called robotClass | |
var robotClass = function(){ | |
}; | |
robotClass.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(100); | |
robot.rotateCannon(360); |
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
//FightCode can only understand your robot | |
//if its class is called robotClass | |
var robotClass = function(){ | |
}; | |
robotClass.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(100); | |
robot.rotateCannon(360); |
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
//FightCode can only understand your robot | |
//if its class is called robotClass | |
var robotClass = function(){ | |
}; | |
robotClass.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(100); | |
robot.rotateCannon(360); |
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
//FightCode can only understand your robot | |
//if its class is called robotClass | |
var robotClass = function(){ | |
}; | |
robotClass.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(100); | |
robot.rotateCannon(360); |
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/python | |
# -*- coding: utf-8 -*- | |
from collections import defaultdict | |
class CountWordsReducer: | |
job_type = 'count-words' | |
def reduce(self, app, items): | |
word_freq = defaultdict(int) |
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/python | |
# -*- coding: utf-8 -*- | |
INPUT_STREAMS = [ | |
'my_app.stream.CountWordsStream' | |
] | |
REDUCERS = [ | |
'my_app.reducer.CountWordsReducer' | |
] |
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/python | |
# -*- coding: utf-8 -*- | |
from os.path import abspath, dirname, join | |
class CountWordsStream: | |
job_type = 'count-words' | |
group_size = 1000 | |
def process(self, app, arguments): |