java project Description In this stage, we’re going to analyze the game state to determine if either of the players has

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

java project Description In this stage, we’re going to analyze the game state to determine if either of the players has

Post by answerhappygod »

java project
Description
In this stage, we’re going to analyze the game state to determine if either of the players has already won the game or it is still ongoing, if the game is a draw, or if the user has entered an impossible game state (two winners, or with one player having made too many moves).
Objectives
In this stage, your program should:
1.Take a string entered by the user and print the game grid as in the previous stage.
2.Analyze the game state and print the result. Possible states:
•Game not finished when neither side has three in a row but the grid still has empty cells.
•Draw when no side has a three in a row and the grid has no empty cells.
•X wins when the grid has three X’s in a row.
•O wins when the grid has three O’s in a row.
•Impossible when the grid has three X’s in a row as well as three O’s in a row, or there are a lot more X's than O's or vice versa (the difference should be 1 or 0; if the difference is 2 or more, then the game state is impossible).
In this stage, we will assume that either X or O can start the game.
You can choose whether to use a space or underscore _ to print empty cells.
Examples
The examples below show outputs and analysis results for different game states. Your program should work in the same way.
Notice that after Enter cells: comes the user input.
Java Project Description In This Stage We Re Going To Analyze The Game State To Determine If Either Of The Players Has 1
Java Project Description In This Stage We Re Going To Analyze The Game State To Determine If Either Of The Players Has 1 (12.74 KiB) Viewed 80 times
Java Project Description In This Stage We Re Going To Analyze The Game State To Determine If Either Of The Players Has 2
Java Project Description In This Stage We Re Going To Analyze The Game State To Determine If Either Of The Players Has 2 (13.46 KiB) Viewed 80 times
Java Project Description In This Stage We Re Going To Analyze The Game State To Determine If Either Of The Players Has 3
Java Project Description In This Stage We Re Going To Analyze The Game State To Determine If Either Of The Players Has 3 (13.19 KiB) Viewed 80 times
Java Project Description In This Stage We Re Going To Analyze The Game State To Determine If Either Of The Players Has 4
Java Project Description In This Stage We Re Going To Analyze The Game State To Determine If Either Of The Players Has 4 (12.97 KiB) Viewed 80 times
Example 1: Enter cells: Xxxoo_o_ 100 x wins Example 2: Enter cells: XOXOXOXXO хох | loxol | | ххо X wins

Example 3: Enter cells: xoopxoxxo Toxo 1 xx0 | Ordins Example 4: XOXOOXXXO Enter cells: IXOX оох ххо | Draw

Example 5: Enter cells: XO_00X_X 100x Game not finished Example 6: Enter cells: xo_XO_XOX Txo. XOX Impossible

Example 7: Enter cells: _0_XXX Impossible Example 8: Enter cells: „0000_XX | 001 Impossible
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply