Tic-Tac-Toe game Abhinav and Anjali are playing the Tic-Tac-Toe game. Tic-Tac-Toe is a game played on a grid that's three squares by three squares. Abhinav is O, and Anjali is X. Players take turns putting their marks in empty squares. The first player to get 3 of her marks in a diagonal or horizontal, or vertical row is the winner. When all nine squares are complete, the game is over. If no player has three marks in a row, the game ends in a tie. Write a program to decide the winner in the Tic-Tac-Toe game. Input The input will be three lines contain O's and X's separated by space. Output The output should be a single line containing either "Abhinav Wins" or "Anjali Wins" or "Tie". Explanation For example, if the input is O X O O X X O O X as three of O's are in vertical row print "Abhinav Wins". Sample Input 1 O X O O X X O O X Sample Output 1 Abhinav Wins Sample Input 2 O O X X X O X O O Sample Output 2 Anjali Wins
1
Expert's answer
2021-10-23T20:31:31-0400
Dear Chethan, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment