backgammon/game.py

22 lines
470 B
Python

from hooman import Human
from board import Board
class Game:
def __init__(self):
self.board = Board()
self.p1 = Human(self.board, "O")
self.p2 = Human(self.board, "X")
def play(self):
while True:
print(self.board.to_s())
roll = self.p1.roll()
self.p1.do_move(roll)
print(self.board.to_s())
roll = self.p2.roll()
self.p2.do_move(roll)
g = Game()
g.play()