Skip to content

Instantly share code, notes, and snippets.

gnzlbg gnzlbg

Block or report user

Report or block gnzlbg

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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;
@14427
14427 / hkt.rs
Last active May 25, 2019
Higher-kinded type trait
View hkt.rs
use std::rc::Rc;
trait HKT<U> {
type C; // Current type
type T; // Type with C swapped with U
}
macro_rules! derive_hkt {
($t:ident) => {
impl<T, U> HKT<U> for $t<T> {
@gnzlbg
gnzlbg / gist:5547905
Created May 9, 2013
variadic zip and join function extensions to boost range
View gist:5547905
#include <iostream>
#include <array>
#include <vector>
#include <list>
#include <deque>
#include "tupleit.hh" // http://pastebin.com/LFkTHdQk
#include <stdio.h>
#include <boost/range.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/adaptors.hpp>
You can’t perform that action at this time.