예제 #1
0
def test_match_human():
    #human vs computer
    u = users.sign_in()
    p1 = players.Human(user=u)
    p2 = players.Computer(difficulty='hard')
    g = games.Cribbage(p1, p2)
    g.game_driver()
예제 #2
0
def test_turncard_sequence():
    print(f'\n-------- Test Turncard Sequence ----------\n')
    #computer vs computer
    p1 = players.Computer(difficulty='medium')
    p2 = players.Computer(difficulty='medium')
    g = games.Cribbage(p1, p2)
    g.deck.shuffle()
    g.determine_dealer_sequence()
    g.turncard_sequence()
예제 #3
0
def test_determine_dealer_sequence():
    print(f'\n-------- Test Determine Dealer Sequence ----------\n')
    #computer vs computer
    p1 = players.Computer(difficulty='medium')
    p2 = players.Computer(difficulty='medium')
    g = games.Cribbage(p1, p2)
    g.deck.shuffle()
    g.determine_dealer_sequence()
    print(f'\n-- Is {g.player_one.name} Dealer? {g.player_one.is_dealer}')
    print(f'\n-- Is {g.player_two.name} Dealer? {g.player_two.is_dealer}')
예제 #4
0
def test_deal_sequence():
    print(f'\n-------- Test Deal Sequence ----------\n')
    #computer vs computer
    p1 = players.Computer(difficulty='medium')
    p2 = players.Computer(difficulty='medium')
    g = games.Cribbage(p1, p2)
    g.deck.shuffle()
    g.determine_dealer_sequence()
    g.deal_sequence()
    print(f'-- {g.player_one.name} hand:')
    g.player_one.display_hand()
    print(f'-- {g.player_two.name} hand:')
    g.player_two.display_hand()
예제 #5
0
def test_discard_sequence():
    print(f'\n-------- Test Discard Sequence ----------\n')
    #computer vs computer
    p1 = players.Computer(difficulty='medium')
    p2 = players.Computer(difficulty='medium')
    g = games.Cribbage(p1, p2)
    g.deck.shuffle()
    g.determine_dealer_sequence()
    g.deal_sequence()
    print(f'-- {g.player_one.name} hand:')
    g.player_one.display_hand()
    print(f'-- {g.player_two.name} hand:')
    g.player_two.display_hand()
    g.discard_sequence()
    print(f'-- {g.player_one.name} hand:')
    g.player_one.display_hand()
    print(f'-- {g.player_two.name} hand:')
    g.player_two.display_hand()
    print('\n----------- The crib --------------')
    for card in g.crib:
        print(f'|| {card.name}')
예제 #6
0
def test_game_driver():
    #computer vs computer
    p1 = players.Computer(difficulty='hard')
    p2 = players.Computer(difficulty='medium')
    g = games.Cribbage(p1, p2)
    g.game_driver()