Computer Science This is a codingbat problem. Please answer in Java and do not change the starter code. You have been asked to write the game of tic tac toe. In the first version of the game, we will only be comparing horizontally for a win. A win is determine by all of the elements in a row either being an X or an O. You need to return a String with the winner or TIE if there is no winner. ticTacToe(["X", "O", "O"], ["X", "O", "O"], ["X", "X", "X"]) → "X" ticTacToe(["X", "O", "X"], ["X", "X", "O"], ["O", "O", "O"]) → "O" ticTacToe(["X", "O", "X"], ["X", "X", "O"], ["O", "X", "O"]) → "TIE"   public String ticTacToe(String[] top, String[] middle, String[] bottom) {    }

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter3: Using Methods, Classes, And Objects
Section: Chapter Questions
Problem 1GZ
icon
Related questions
Question

Computer Science

This is a codingbat problem. Please answer in Java and do not change the starter code.

You have been asked to write the game of tic tac toe. In the first version of the game, we will only be comparing horizontally for a win. A win is determine by all of the elements in a row either being an X or an O. You need to return a String with the winner or TIE if there is no winner.


ticTacToe(["X", "O", "O"], ["X", "O", "O"], ["X", "X", "X"]) → "X"
ticTacToe(["X", "O", "X"], ["X", "X", "O"], ["O", "O", "O"]) → "O"
ticTacToe(["X", "O", "X"], ["X", "X", "O"], ["O", "X", "O"]) → "TIE"

 

public String ticTacToe(String[] top, String[] middle, String[] bottom) {
  
}

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT