March 2018
Intermediate to advanced
324 pages
8h 30m
English
Now that horizontal and vertical lines are covered, we should move our attention to diagonal combinations:
@Test
public void whenPlayAndTopBottomDiagonalLineThenWinner() {
ticTacToe.play(1, 1); // X
ticTacToe.play(1, 2); // O
ticTacToe.play(2, 2); // X
ticTacToe.play(1, 3); // O
String actual = ticTacToe.play(3, 3); // X
assertEquals("X is the winner", actual);
}
Read now
Unlock full access