Exemple #1
0
def execute():
    ai = Player()

    ai.bank = 3000
    ai.limit = 3000

    op = Opponent()

    op.bank = 3000

    participants = [ai, op]

    game = Game()

    game.handout(1)

    pre_chance, _ = game.make_round(participants)

    floop_chance, _ = game.make_round(participants)

    turn_chance, _ = game.make_round(participants)

    game.make_round(participants)

    river_chance, gess = game.make_round(participants)

    return gess, river_chance, turn_chance, floop_chance, pre_chance
Exemple #2
0
def execute(participants, game_num, small_blind, num_of_members):
    print('\n №{}\n'.format(game_num))

    if game_num == 1:
        fill_banks_of_members(participants, num_of_members, bank=limit)

    participants[0].limit = participants[0].bank
    participants[0].blef_rises = 0

    for p in participants:
        p.in_game = True

    kol = Game(game_num, small_blind)

    kol.handout(num_of_members - 1)
    kol.make_round(participants)
    kol.make_round(participants)
    kol.make_round(participants)
    kol.make_round(participants)
    kol.make_round(participants)

    for p in participants:
        add_money(p, limit)

    check_banks(participants)

    if len(participants) == 1:
        print('Игра окончена: победитель {}, выигрыш ${}'.format(
            participants[0].nick, participants[0].bank))
        exit()

    return kol.game_num