Created
December 21, 2015 14:41
-
-
Save mekhami/3c2b5b18a0eeabac5d5b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Board(): | |
| def __init__(self): | |
| self.board = self.create_board() | |
| def is_finished(self): | |
| return self.board.length == 9 | |
| def is_won(self): | |
| return winner(self.board.length) | |
| def winner(board): | |
| # do some logic and see if there's a win in here somewhere | |
| # return true or false | |
| def __str__(self): | |
| return self.board | |
| def reset(self): | |
| self.board = self.create_board() | |
| def create_board(self): | |
| self.board = ' ' * 9 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment