Created
June 21, 2015 07:09
-
-
Save zamfi/4e0c3af1bc2aa2c0532e to your computer and use it in GitHub Desktop.
This file contains 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
def determine_winner(board): | |
""" board takes the form of a String | |
with the indices representing each | |
of these squares: | |
0 | 1 | 2 | |
---+---+--- | |
3 | 4 | 5 | |
---+---+--- | |
6 | 7 | 8 | |
""" | |
return 'X' | |
def test_board_winner(board, winner): | |
if determine_winner(board) is winner: | |
print "SUCCESS" | |
else: | |
print "Expected", winner, "got", determine_winner(board) | |
test_board_winner("XXXOX OO ", "X") | |
test_board_winner(" ", None) | |
test_board_winner("XO XO OXX", "X") | |
test_board_winner(" XOXOXOXO ", "O") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment