Skip to content

Instantly share code, notes, and snippets.

Avatar

Benjamin Spector Sydriax

View GitHub Profile
@Sydriax
Sydriax / GetGinis.py
Last active Jan 6, 2017
Gini Coefficient Code
View GetGinis.py
"""
Takes a folder as its argument. Searches for all files (must be .hlt!) in that folder,
calculates their Gini coefficients, and then creates a json file ('ReplayGinis.json')
which contains the replay names and their associated Gini coefficients.
"""
import sys, json, numpy, os
out = open('ReplayGinis.json', 'w')
out.write('{')
for filename in os.listdir(sys.argv[1]):
@Sydriax
Sydriax / PerimBot.py
Created Dec 18, 2016
Grid-Based Expansion for halite.io
View PerimBot.py
# Note: Uses a modified version of @erdman's starter package, also contained in this gist.
import hlt
from hlt import *
import random
myID, game_map = hlt.get_init()
debug = open('debug.log', 'w')
@Sydriax
Sydriax / Improving the Halite Random Bot (Python 3)
Last active Nov 13, 2016
Halite Random Improvement Sample Code (Python 3)
View Improving the Halite Random Bot (Python 3)
This Gist contains the sample code for improving the sample Halite random bot in Python 3.
@Sydriax
Sydriax / Improving the Halite Random Bot (Java)
Last active Mar 14, 2017
Halite Random Improvement Sample Code (Java)
View Improving the Halite Random Bot (Java)
This Gist contains the sample code for improving the sample Halite random bot in Java.
@Sydriax
Sydriax / Improving the Halite Random Bot (C++)
Last active Oct 29, 2016
Halite Random Improvement Sample Code (C++)
View Improving the Halite Random Bot (C++)
This Gist contains the sample code for improving the sample Halite random bot in C++.