Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

private static boolean isColWin(String player) // checks for a col win for specified player private static boolean isRowWin(String player) ll checks for a row win

image text in transcribed
private static boolean isColWin(String player) // checks for a col win for specified player private static boolean isRowWin(String player) ll checks for a row win for the specified player private static boolean isDiagnalWin(String player) // checks for a diagonal win for the specified player private static boolean is'I'ie() // checks for a tie condition: all spaces on the board are filled OR there is an X and an O in every win vector (i.e. all possible 8 wins are blocked by having both and X and an O in them.) 6. Create a pseudo code outline for the program using java comments and then code the game. Your program should: Clear the board and set the player to X (since X always moves first) get the coordinates for the move which should be 1 3 for the row and col convert the player move to the array indices which are 0 2 by subtracting 1 loop until the converted player coordinates are a valid move if appropriate check for a win or a tie (i.e. if it is possible for a win or a tie at this point in the game, check for it.) If there is a win or tie announce it and then prompt the players to play again. Toggle the player (i.e. X becomes 0, 0 becomes X) 7. Put screen shots at the end of this file to show that you have thoroughly tested the game: X wins 0 wins Tie One showing the re-prompt for a move that is invalid. (i.e. player tries to move to a cell that already has an X or an O in it

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions