Exemplo n.º 1
0
def test_flip_reserve():
    (hand, reserve) = ([], [(2,), (5,), (11,)])
    (n_hand, n_reserve) = cards.flip_reserve(hand, reserve)
    assert len(n_hand) == 3
    assert n_reserve == []
    assert hand != n_hand
    assert reserve != n_reserve
Exemplo n.º 2
0
def test_flip_reserve():
    (hand, reserve) = ([], [(2, ), (5, ), (11, )])
    (n_hand, n_reserve) = cards.flip_reserve(hand, reserve)
    assert len(n_hand) == 3
    assert n_reserve == []
    assert hand != n_hand
    assert reserve != n_reserve
Exemplo n.º 3
0
def flip_if_needed(player, n=1):
    (hand, reserve) = player
    if len(hand) < n:
        (hand, reserve) = cards.flip_reserve(hand, reserve)
    return (hand, reserve)
Exemplo n.º 4
0
def flip_if_needed(player, n=1):
    (hand, reserve) = player
    if len(hand) < n:
        (hand, reserve) = cards.flip_reserve(hand, reserve)
    return (hand, reserve)