Question: TIC-TAC-TOE Create a Java program. Your task is to develop a tic-tac-toe game. There are two options for you to choose from. One option is
TIC-TAC-TOE
Create a Java program. Your task is to develop a tic-tac-toe game. There are two options for you to choose from. One option is a tictac-toe game where two humans may play. The second option is one where a human may play against the computer. Option one is worth less points (90% of total points) than option two (100% of total points).
USE STRING AS THE ENTRY OF THE USER! THEN CONVERT IT TO INT PROGRAM REQUIREMENTS 1. The program prompts users for their names and ensures (validates) them; users are allowed to enter a single username consisting of alpha chars ONLY. 2. Use one-dimensional arrays to keep track of the game: a. Human moves in the case of option one. b. Computer moves as well in the case of option two. 3. Use functions to pass arrays and implement other program requirements such as input validation, checking to ensure that places selected by users are available on the game board. 4. Validate user input at every opportunity. a. Do not allow number entries less than 0 or entries greater than 8 (in the case you are using numbers 0-8 on the grid. b. Do not allow number entries less than 0 or entries greater than 8 (in the case you are using numbers 1-9 on the grid. c. Do not allow non-numeric entries. 5. The program must be developed using functions so that the main() function consists mostly of function calls. 6. Below is a suggested list of functions for you to consider in the development of this project: a. splashScreen()//displays game and developers information b. askForUserNames()//requests for username c. validateUserName()//validate username d. switchPlayer()//switch from one player to another e. resetGame()//reset the game when one concludes; this includes filling the array with vales 0-8 f. displayGrid()//display the grid after each player makes a move g. playerMakeMove()//prompts player to make a move, invokes validatePlayersMove, checkPositionAvailability h. validatePlayersMove()//validates that user entry X is such that 0 7. In the case of option two, additional functions you may want to consider are: a. makeBestMove()//select best option b. computerMakeMove()//used to make the move, in other words populate the array 8. The main() function must use a loop to keep the user in the program until he/she wants to quit. Users should be allowed to play as many games as they want. 9. You must use meaningful variable names. 10. You must comment your code. 11. You must use variables of the correct type and initialize them with a proper value. 12. Your program must detect a winner if there is one 13. Your program must determine if a tie occurs
Restrictions: 1. No infinite loops, examples include: a. for(;;) b. while(1) c. while(true) d. do{//code}while(1); 2. No break statements to exit loops
1. At the start of the game, an initial Splash screen must be displayed which includes: a. The games title b. Your name 
2. Prompt player1 for a name and validate input; no white space, no numbers and a single word!
3. Prompt player2 for a name (validate input!) 
4. Once you have the players names, start the game
5. Be sure to validate user entries; no white space, no numbers X, such that 0
6. Alternate from one player to another (dont forget to validate!) 
7. Dont allow players to select a square which is already in use (Sandra Here chose 1)
8. A winner is detected when one occurs and a request to play again is made. Dont forget to validate!
9. A tie is detected when one occurs. 
10. Program ends when players dont want to play anymore 
D C: Users floresla DebuglProjectl.exe TIC TAC TOE Prof Flores Press any key to continue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
