states[hs["gamestate"]][state][2] = get_next_unique_state( dll_plrmodel, zp, act_str + "1", states) if states[hs["gamestate"]][state][2] != None: ur.next[1] = pointer(states[hs["gamestate"]][state][2][4]) if possible[2] == True: states[hs["gamestate"]][state][3] = get_next_unique_state( dll_plrmodel, zp, act_str + "2", states) if states[hs["gamestate"]][state][3] != None: ur.next[2] = pointer(states[hs["gamestate"]][state][3][4]) ur.model_tree = dll_plrmodel.generate_empty_plrmodel_tree( None, None, 0, hs["gamestate"], hs["gamestate"]) states[hs["gamestate"]][state][4] = ur return states[hs["gamestate"]][state] gamedir = sys.argv[1] zp = libzpoker.libzpoker(gamedir) dll_plrmodel = cdll.LoadLibrary("libplrmodel.dylib") dll_plrmodel.generate_empty_plrmodel_tree.restype = c_void_p states = [{}, {}, {}, {}, {}] old_lens = [0, 0, 0, 0] act_str = "" get_next_unique_state(dll_plrmodel, zp, act_str, states) #print states
import libzpoker import sys zp = libzpoker.libzpoker() zp.load_diffs(1) type_list = zp.build_pyramid2(range(zp.i.n_types[1]), zp.diffs[1]) diffs = zp.diffs[1] final_i1 = type_list[0] final_i2 = type_list[-1] for i, x in enumerate(type_list): print diffs[x, final_i1], diffs[ x, final_i2], diffs[x, final_i1] - diffs[x, final_i2], x, i
import libzpoker import numpy zp = libzpoker.libzpoker("testipeli") zp.load_hand_wtl_odds() nh = 32 for x in xrange(nh): print x, zp.hand_wtl_odds[1, nh + x, nh:nh * 2]