Your question is TicTacToe Move Handling. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Scribd's mobile reading experience may need lightweight game-state logic for interactive content. Given a legal sequence of Tic-Tac-Toe moves, determine whether player A won, player B won, the game is a draw, or play is still pending.
Players alternate turns, with A moving first. The board has three rows and three columns. A player wins immediately after placing a mark in an entire row, column, or diagonal. The input sequence stops when the game ends or when all nine cells are filled.
Implement tictactoe(moves), where moves is a list of coordinate pairs. The first pair belongs to A, the second to B, and so on. Return one of the strings "A", "B", "Draw", or "Pending".
def tictactoe(moves):