backgammon/game.py

23 lines
490 B
Python
Raw Normal View History

2018-02-05 21:31:34 +00:00
from hooman import Human
from board import Board
from bot import Bot
2018-02-05 21:31:34 +00:00
class Game:
def __init__(self):
self.board = Board()
self.p1 = Human(self.board, "O")
self.p2 = Bot(self.board, "X")
2018-02-05 21:31:34 +00:00
def play(self):
while True:
# print(self.board.to_s())
2018-02-05 21:31:34 +00:00
roll = self.p1.roll()
self.p1.do_move(roll)
# print(self.board.to_s())
2018-02-05 21:31:34 +00:00
roll = self.p2.roll()
self.p2.do_move(roll)
g = Game()
g.play()