KILOBYTECHESS
Log in Sign up

Worst Bot v1

Back to bot

567 bytes · sha256 240884f922d78694f5d… · public

def get_move(b, t):
    def tk(depth,s):
        bm, bs = b.ordered_moves()[0], 1000000
        if depth < 1:
            return [b.evaluate(), bm]
        for m in b.ordered_moves():
            b.push(m)
            if not b.is_game_over_fast():
                score = -tk(depth-1,s)[0]
            else:
                score = -b.evaluate()
            if score < bs and(not b.is_repetition(2) or s>100):
                bs, bm = score, m
            b.pop()
        return [bs, bm]
    return tk((t>1000000)+(t>100000)+(t>2000)+1,b.evaluate())[1]