generated from mwc/lab_tic_tac_toe
To decide on a winner, the game needs to check each of the winning combinations on the board for either x symbols or o symbols and then return the correct winner. To do this, I utilized 2 functions, a check_winning_combo, which checked each index in each combination to see if an x or o symbol was present, and then a check_winner which sent each possible winning combination through check_winning combo. If the combo did not have all x's or all o's (a mix of x's and o's and/or blanks) the check_winning combo returned false otherwise it returned true. |
||
---|---|---|
.. | ||
game.py | ||
player.py | ||
view.py |