Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Use a two-dimensional array to write a game of Tic-Tac-Toe that represents the b

ID: 3529037 • Letter: U

Question

Use a two-dimensional array to write a game of Tic-Tac-Toe that represents the board. Your program should prompt the user to choose who goes first and the user can play the game multiple times. The implemented strategy will complete a 2-in-a-row if possible and will otherwise block a user 2-in-a-row. The program recognizes a win by either player and a cat's game situation when it is the computer's turn. Let's play tic tac toe Do you want to go first? y Your move? 2 2 ------------- | | | | ------------- | | X | | ------------- | | | | ------------- I move to 1, 3 ------------- | | | O | ------------- | | X | | ------------- | | | | ------------- Your move? 3 1 ------------- | | | O | ------------- | | X | | ------------- | X | | | ------------- I move to 1, 2 ------------- | | O | O | ------------- | | X | | ------------- | X | | | ------------- Your move? 1 1 ------------- | X | O | O | ------------- | | X | | ------------- | X | | | ------------- I move to 2, 1 ------------- | X | O | O | ------------- | O | X | | ------------- | X | | | ------------- Your move? 3 3 ------------- | X | O | O | ------------- | O | X | | ------------- | X | | X | ------------- You win ------------- | X | O | O | ------------- | O | X | | ------------- | X | | X | ------------- Want to play again? y ...Steps Skipped... I move to 2, 3 I win ------------- | X | | O | ------------- | | X | O | ------------- | X | | O | ------------- Want to play again?

Explanation / Answer

//I'm not exactly sure how to implement stratagy without repeating code, but you can view this file for idea.Note all more is random

https://www.dropbox.com/s/wx56xrb02xk3gbq/TicTacToeJava.txt