Skip to content

Instantly share code, notes, and snippets.

Michael Heasell MHeasell

View GitHub Profile
@MHeasell
MHeasell / zero-sum.js
Created Apr 15, 2015
My CodeCombat Zero Sum tournament entry, compiled version. Check out https://gist.github.com/MHeasell/e7ddb00a279d141d03fd for the source code and http://michaelheasell.com/blog/2015/04/08/zero-sum-my-winning-strategy/ for my strategy write-up.
View zero-sum.js
function vecAdd(a, b) {
return {
x: a.x + b.x,
y: a.y + b.y
};
}
function vecSub(a, b) {
return {
x: a.x - b.x,
y: a.y - b.y
@MHeasell
MHeasell / bins.js
Created Apr 8, 2015
My CodeCombat Zero Sum tournament entry source code. Check out https://gist.github.com/MHeasell/bb9f7253da45b5140a83 for the compiled version and http://michaelheasell.com/blog/2015/04/08/zero-sum-my-winning-strategy/ for a full write-up about my strategy.
View bins.js
// bin stuff -------------------------------------------------------------------
const BIN_WIDTH = 13.333333333333;
const HALF_BIN_WIDTH = (BIN_WIDTH / 2);
const BIN_HEIGHT = 14;
const HALF_BIN_HEIGHT = (BIN_HEIGHT / 2);
const NUM_BINS_X = 6;
const NUM_BINS_Y = 5;
You can’t perform that action at this time.