Skip to content

Instantly share code, notes, and snippets.

View erdman's full-sized avatar

Travis Erdman erdman

  • Portland, OR
View GitHub Profile
@erdman
erdman / RandomBot.py
Last active December 12, 2016 00:28
Improving the Halite RandomBot (Python3)
import hlt
from hlt import NORTH, EAST, SOUTH, WEST, STILL, Move, Square
import random
myID, game_map = hlt.get_init()
hlt.send_init("RandomPythonBot")
while True:
game_map.get_frame()
@erdman
erdman / embedly
Created February 10, 2012 22:57
embedly challenge
import Data.List
fact :: Integer -> Integer
fact x = foldl' (*) 1 [1..x]
sumdigits :: Integer -> Integer
sumdigits x
| x < 10 = x
| otherwise = let (a,b) = x `divMod` 10 in b + sumdigits a