April 30d Coding Challenge > Tic-Tac-Toe I
TTT is a two player game with a 3x3 grid. First player picks an open square and puts a X, the second player draws an O. Players take turns till one of the players wins (gets the of the marks in a row). Game is a draw when all 9 squares are filled up without a winner.
Write a program to build a two player game with win/draw detection.
You will be writing the following methods.
String play(char player, int x, int y)
- Returns
OK
- if it is player’s turn and the spot is free.BAD
- not ok.String checkWin()
- Returns
X WON
- Player X WonO WON
- Player O WonDRAW
- No winner, board fullINPROGRESS
- No winner, game not overBAD BOARD
- Bad board state, ex. three Xs and only one OsTo Discuss more and follow up, join us at SDE Skills Discord Server, use the #women-in-tech channel.
Note: While there is no submission deadline per-se, we recommend you answer these questions as soon as they are posted.