def quickdraw(f, depth): for line in f: line = line.strip() print(line) pos = xboard.parseFEN(line) for d in range(depth, 99): s0 = sunfish.bound(pos, 0, d) s1 = sunfish.bound(pos, 1, d) if s0 >= 0 and s1 < 1: break print(d, s0, s1, xboard.pv(0, pos)) else: print("Fail: Unable to find draw!") return