예제 #1
0
def test_termination():
    root = KuhnRootChanceGameState(CARDS_DEALINGS)
    assert not root.is_terminal()
    assert not root.play(KQ).play(BET).is_terminal()
    assert not root.play(JQ).play(CHECK).play(BET).is_terminal()
    assert not root.play(QJ).play(CHECK).is_terminal()

    assert root.play(KQ).play(BET).play(FOLD).is_terminal()
    assert root.play(JQ).play(CHECK).play(CHECK).is_terminal()
    assert root.play(JK).play(BET).play(CALL).is_terminal()
    assert root.play(QJ).play(CHECK).play(BET).play(FOLD).is_terminal()
    assert root.play(QJ).play(CHECK).play(BET).play(CALL).is_terminal()
def test_termination():
    root = KuhnRootChanceGameState(2, CARDS_DEALINGS)

    assert not root.is_terminal()
    assert not root.play(K0Q0).play(BET).is_terminal()
    assert not root.play(J0Q0).play(CHECK).play(BET).is_terminal()
    assert not root.play(Q0J0).play(CHECK).is_terminal()

    assert root.play(K0Q0).play(BET).play(FOLD).is_terminal()
    assert root.play(J0Q0).play(CHECK).play(CHECK).is_terminal()
    assert root.play(J0K0).play(BET).play(CALL).is_terminal()
    assert root.play(Q0J0).play(CHECK).play(BET).play(FOLD).is_terminal()
    assert root.play(Q0J0).play(CHECK).play(BET).play(CALL).is_terminal()