Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In Java Submit vour .Java file to Blackboard. CSC 222 Program 4 Topics: methods, global variables In this program, you will practice writing methods and
In Java
Submit vour .Java file to Blackboard. CSC 222 Program 4 Topics: methods, global variables In this program, you will practice writing methods and using global variables by creating a text-based Tic-tactoe game. You will still need to know how to write loops, if or switch statement. In this game, two players X and O plays against each other. The goal is to win by placing a sequence of three X or three O. The sequence can be a row, a column, or a diagonal. The game is a tie when all the cells are taken by there's no winning sequence. By default, X is the first player. The game starts by asking the current player to make a move. The program checks to see if the move is a winning move. If the current player wins or the game is a tie, the program displays the appreciate message and ask if they user want to start another game. The user specifies his or her move by entering the row and the column of the cell on the board. For example, if the user wants to place the move on the top left cell, he/she would enter 11 at the prompt. Below is the board with the rows and columns for each cell. The user should not be able to place the move on a cell that is already taken by the user or the opponent. If the user attempts to place a move on a cell that's taken, the game won't allow the move and will ask the user to make the move again. See sample run to understand the program logic. Below are the methods and what they do. You will need to complete the methods for the program to work. My suggestion is to build it bottom up. Start with being able to display the board, clearing the board, placing X or O on the board. Once that's done, you can create the main logic which would presents the board to the user, ask the user to make a move, and displaying the board again and rotating the player. Once that's working, you can then check for winner or for a tieStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started