Beispiel #1
0
def test_play_game():
    game = War(human=False)
    game.play_game()
    n.assert_equal(len(game.player1) + len(game.player2) + len(game.pot), 52)
    n.assert_is_not_none(game.winner)
    if game.player1.name == game.winner:
        n.assert_equal(len(game.player2), 0)
    else:
        n.assert_equal(len(game.player1), 0)
Beispiel #2
0
def test_play_game():
    game = War(human=False)
    game.play_game()
    n.assert_equal(len(game.player1) + len(game.player2) + len(game.pot), 52)
    n.assert_is_not_none(game.winner)
    if game.player1.name == game.winner:
        n.assert_equal(len(game.player2), 0)
    else:
        n.assert_equal(len(game.player1), 0)
Beispiel #3
0
from Deck import Deck
from Player import Player
from war import War

if __name__ == "__main__":
    deck = Deck()
    Jon = Player("Jon Snow")
    Dave = Player("David Spade")
    war = War(Jon, Dave)
    deck.build_deck()
    deck.shuffle()
    war.deal(deck)

    # print(Dave)
    # # Dave.print_hand()
    # print(Jon)
    # Jon.print_hand()
    war.play_game()
    deck.shuffle()