#!/usr/bin/env python
from string import ascii_lowercase
import gmwbot

def logcalls(f):
    def logged(*args, **kwargs):
        print 'called', ''.join(args[0])
        return f(*args, **kwargs)
    return logged
words = list(ascii_lowercase)
g = gmwbot.delayedobst(words, [1]*len(words), [0]*(len(words)+1),
        obstfactory=logcalls(gmwbot.obstguesser))

print g('b', 'f')  # build
print g('b', 'f')
print g('b', 'd')
print g('d', 'f')
print g('a', 'd')  # build
print g('c', 'f')  # build
print g('a', 'h')  # build

print g(None, 'f')  # build
print g(None, 'e')

print g('w', None)  # build
print g('x', None)
