Skip to content

Instantly share code, notes, and snippets.

View shanemhansen's full-sized avatar

Shane Hansen shanemhansen

View GitHub Profile
@shanemhansen
shanemhansen / win.py
Created March 27, 2014 23:11 — forked from fungus/win.py
#!/usr/bin/python
SIZE = 4
import sys
import dbhash
import random
from time import time
from multiprocessing import Process, Queue
from term2048.game import Game
class maybe(object):
def __init__(self, original):
self.original = original
def __getattr__(self, attr):
if hasattr(self.original, attr):
return maybe(getattr(self.original, attr))
return maybe(None)
def __call__(self):
return self.original