Ejemplo n.º 1
0
#!/usr/bin/env python
import sys
from eval import I, is_int
from game import GameState

#DEBUG = sys.argv[1] == '0'
DEBUG = False

g= GameState(sys.argv[1],debug=DEBUG,eval_=True)
g.start()

Turn=g.turn



def buildno(n,m=0):
	if n==m:
		if m==0:
			return ['zero']
		else:
			return []
	elif (n%2==0) and ((m==0) or (n/m>=2)):
		return ['dbl']+buildno(n/2,m)
	else:
		return ['succ']+buildno(n-1,m)

def log(msg, s='x'):
	if DEBUG: print >>sys.stderr, s*70, 'OP', msg

class comb(int):
	def __init__(self,i,clear=False):