示例#1
0
 def multi(h1, h2, board):
     r = cpoker.multi_holdem([h1, h2], board)
     if r != poker.multi_holdem([h1, h2], board):
         for h in [h1, h2, board]:
             print utils.make_pretty(h)
         print r
         print poker.multi_holdem([h1, h2], board)
         assert False
     return r[0] if len(r) == 1 else 2
示例#2
0
文件: tests.py 项目: kvonhorn/pokyr
 def multi(h1, h2, board):
     r = cpoker.multi_holdem([h1, h2], board)
     if r != poker.multi_holdem([h1, h2], board):
         for h in [h1, h2, board]:
             print(utils.make_pretty(h))
         print(r)
         print(poker.multi_holdem([h1, h2], board))
         assert False
     return r[0] if len(r) == 1 else 2
示例#3
0
def test_multi_holdem():

    for hands, board, result in [
        (["5d 6h", "5h Kh", "8h 8s"], "Ah Ks Qc 6s 8c", [2]),
        (["9h 5s", "7d 7c", "6d 2d"], "2s Kh 7s 5h 8h", [1]),
        (["Jd Tc", "Ts Th", "Td Ac"], "9h 3c Jc Qs Ad", [2]),
        (["Qh 2c", "Kd 6s", "8s Js"], "4s Kh Ah Ks Jc", [1]),
        (["5h 8c", "Tc 4c", "3h As"], "7d Ah 8d 3s 9c", [2]),
        (["4h Js", "3h Jc", "4d 5s"], "As Ks Kh 8d Ah", [0, 1]),
        (["2c 6d", "5h Kd", "7d 5c"], "Ah 6s 9s Td 6h", [0]),
        (["Jd 4h", "Kh 8h", "9d 5h"], "Jh Qd Ad Qh Ks", [1]),
        (["Qc 7d", "Th Jc", "As 8c"], "Qh 5d 7h 9h Jd", [0]),
        (["4d Kc", "Qc 4h", "5s Jd"], "Ks 9s 5c Qd 2c", [0]),
        (["6h Ks", "9c 9s", "3h 2c"], "5s Td 4c 3c Kh", [0]),
        (["9h 7d", "8h 4h", "5d 3h"], "Kc Jd Ad 5s 8c", [1]),
        (["Ts Js", "8h 7h", "7s 3h"], "As Jh 2c Ac 3c", [0]),
        (["Ah Ts", "2s 7d", "Kh Js"], "7c 3s 3d Td 7s", [1]),
        (["9d 5h", "Kh 6h", "8d 8c"], "Ks 4d 7h Qd Th", [1]),
        (["7c Js", "Ah Kc", "Jc 6c"], "2d Qh 4h 5d 2c", [1]),
        (["3d 8d", "Ts 4d", "Ah 5s"], "3c 9d As 6s Jd", [2]),
        (["4s 6c", "6s Qs", "9c 3d"], "Th Ac 2d 8h 2h", [1]),
        (["Qd Ah", "Jc 9h", "6c 7c"], "3s Tc 6s 4d 4c", [2]),
        (["Ad 6s", "3c 2d", "9d 8s"], "6d Th 3h Ah 9h", [0]),
        (["Ad 6s", "3c Jd", "9d 8s", "As Jc"], "6d Th 7h 8s 9h", [1, 3]),
        (["Ad 6s", "3c 2d", "9d 8s", "As Ac"], "6d Th 7h 8s 9h", [0, 1, 2, 3]),
        (["Ad 6s", "Js 2d", "Jd 8s", "Qs Jc", "8c 8d"], "6d Th 7h 8s 9h", [3]),
    ]:
        assert (
            cpoker.multi_holdem([utils.to_cards(h) for h in hands], utils.to_cards(board))
            == poker.multi_holdem([utils.to_cards(h) for h in hands], utils.to_cards(board))
            == result
        )
示例#4
0
文件: tests.py 项目: kvonhorn/pokyr
def xtest_multi_holdem():

    for hands, board, result in [
        (['5d 6h', '5h Kh', '8h 8s'], 'Ah Ks Qc 6s 8c', [2]),
        (['9h 5s', '7d 7c', '6d 2d'], '2s Kh 7s 5h 8h', [1]),
        (['Jd Tc', 'Ts Th', 'Td Ac'], '9h 3c Jc Qs Ad', [2]),
        (['Qh 2c', 'Kd 6s', '8s Js'], '4s Kh Ah Ks Jc', [1]),
        (['5h 8c', 'Tc 4c', '3h As'], '7d Ah 8d 3s 9c', [2]),
        (['4h Js', '3h Jc', '4d 5s'], 'As Ks Kh 8d Ah', [0, 1]),
        (['2c 6d', '5h Kd', '7d 5c'], 'Ah 6s 9s Td 6h', [0]),
        (['Jd 4h', 'Kh 8h', '9d 5h'], 'Jh Qd Ad Qh Ks', [1]),
        (['Qc 7d', 'Th Jc', 'As 8c'], 'Qh 5d 7h 9h Jd', [0]),
        (['4d Kc', 'Qc 4h', '5s Jd'], 'Ks 9s 5c Qd 2c', [0]),
        (['6h Ks', '9c 9s', '3h 2c'], '5s Td 4c 3c Kh', [0]),
        (['9h 7d', '8h 4h', '5d 3h'], 'Kc Jd Ad 5s 8c', [1]),
        (['Ts Js', '8h 7h', '7s 3h'], 'As Jh 2c Ac 3c', [0]),
        (['Ah Ts', '2s 7d', 'Kh Js'], '7c 3s 3d Td 7s', [1]),
        (['9d 5h', 'Kh 6h', '8d 8c'], 'Ks 4d 7h Qd Th', [1]),
        (['7c Js', 'Ah Kc', 'Jc 6c'], '2d Qh 4h 5d 2c', [1]),
        (['3d 8d', 'Ts 4d', 'Ah 5s'], '3c 9d As 6s Jd', [2]),
        (['4s 6c', '6s Qs', '9c 3d'], 'Th Ac 2d 8h 2h', [1]),
        (['Qd Ah', 'Jc 9h', '6c 7c'], '3s Tc 6s 4d 4c', [2]),
        (['Ad 6s', '3c 2d', '9d 8s'], '6d Th 3h Ah 9h', [0]),
        (['Ad 6s', '3c Jd', '9d 8s', 'As Jc'], '6d Th 7h 8s 9h', [1, 3]),
        (['Ad 6s', '3c 2d', '9d 8s', 'As Ac'], '6d Th 7h 8s 9h', [0, 1, 2, 3]),
        (['Ad 6s', 'Js 2d', 'Jd 8s', 'Qs Jc', '8c 8d'], '6d Th 7h 8s 9h', [3])
    ]:
        assert (cpoker.multi_holdem([utils.to_cards(h) for h in hands], utils.to_cards(board)) ==
        poker.multi_holdem([utils.to_cards(h) for h in hands], utils.to_cards(board)) ==
        result)