Registrations Closing Soon for DevOps Certification Training by CloudxLab | Registrations Closing inEnroll Now
In this step we will write the logic to determine the winner. To achieve this, we will also list all possible combinations of 3 boxes that must be filled with the same symbol for a player to win.
Write a function
winner as shown below. This functions takes an argument called
def <<your code goes here>>(<<your code goes here>>): WAYS_TO_WIN = ((0, 1, 2), (3, 4, 5), (6, 7, 8), (0, 3, 6), (1, 4, 7), (2, 5, 8), (0, 4, 8), (2, 4, 6)) for row in WAYS_TO_WIN: if board[row] == board[row] == board[row] != EMPTY: winner = board[row] return winner if EMPTY not in board: return TIE return None
No hints are availble for this assesment
Answer is not availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here