about | help | code help+videos | done | prefs |
array2D_ticTacToe
Given three 1D String arrays containing either X's, O's, or spaces, create a 2D String array from them and return a String of who has won the game of tic-tac-toe based on the current state of the board. You should either return "X's win!", "O's win!", or "Tie!" Start your solution out with the following code: String[][] board = {row1, row2, row3};Hint: if(board[0][0].equals("X") && board[0][1].equals("X") && board[0][2].equals("X")) would check if the top row of the board was all X's! array2D_ticTacToe(["X", "X", "X"], [" ", " ", " "], [" ", " ", " "]) → "X's win!" array2D_ticTacToe([" ", " ", " "], ["X", "X", "X"], [" ", " ", " "]) → "X's win!" array2D_ticTacToe([" ", " ", " "], [" ", " ", " "], ["X", "X", "X"]) → "X's win!" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy