Esempio n. 1
0
def test_display_board():
    print('\n--------- Test Update Pegs -------------\n')
    u1 = users.User(username='******', email='*****@*****.**')
    u2 = users.User(username='******', email='*****@*****.**')
    p1 = players.Human(name='Jon', user=u1, lane=1)
    p2 = players.Human(name='Rick', user=u2, lane=2)
    b = board.Classic(player_one=p1, player_two=p2)
    b.display_board()
Esempio n. 2
0
 def __init__(self, player_one, player_two): 
     self.player_one = player_one    #players.Player() object
     self.player_two = player_two    
     self.board = board.Classic(self.player_one, self.player_two)             
     self.deck = deck.Deck()      
     self.game_not_over = True
     self.peg_count = 0
     self.crib = []
     self.turncard = None
Esempio n. 3
0
def test_Classic_constructor():
    print('\n--------- Test Board constructor -------------\n')
    u1 = users.User(username='******', email='*****@*****.**')
    u2 = users.User(username='******', email='*****@*****.**')
    p1 = players.Human(name='Jon', user=u1, lane=1)
    #p2 = players.Human(name='Rick', user=u2, lane=2)
    p2 = players.Computer(difficulty='hard', lane=2)
    b = board.Classic(player_one=p1, player_two=p2)
    print(f'- Player 1 name:     {b.player_one.name}')
    print(f'- Player 2 name:     {b.player_two.name}\n')
    b.display_board()
Esempio n. 4
0
def play_classic(user, settings):

    #Game Setup Procedures
    player_vec = initialize_players(user, settings)
    users = player_vec['users']
    players = player_vec['players']
    p1 = players[0]
    p2 = players[1]
    d = deck.Deck()
    d.shuffle()
    b = board.Classic(p1.name,p2.name)
    print(f'\n    {p1.name}   vs   {p2.name}     \n')
Esempio n. 5
0
def test_update_pegs():
    print('\n--------- Test Update Pegs -------------\n')
    u1 = users.User(username='******', email='*****@*****.**')
    u2 = users.User(username='******', email='*****@*****.**')
    p1 = players.Human(name='Jon', user=u1, lane=1)
    p2 = players.Human(name='Rick', user=u2, lane=2)
    b = board.Classic(player_one=p1, player_two=p2)
    p1.score = 15
    b.update_pegs()
    p2.score = 25
    b.update_pegs()
    b.display_board()
    p1.score = 35
    b.update_pegs()
    p2.score = 40
    b.update_pegs()
    b.display_board()
    print(f'Player one: {b.player_one.score}')
    print(f'Player two: {b.player_two.score}')
    print(f'lane1 lead: {b.lane1_lead_peg}')
    print(f'lane1 hind: {b.lane1_hind_peg}')
    print(f'lane2 lead: {b.lane2_lead_peg}')
    print(f'lane2 hind: {b.lane2_hind_peg}')