官术网_书友最值得收藏!

Test – winning condition II

We should also check whether there is a win by filling the vertical line:

@Test
public void whenPlayAndWholeVerticalLineThenWinner() {
  ticTacToe.play(2, 1); // X
  ticTacToe.play(1, 1); // O
  ticTacToe.play(3, 1); // X
  ticTacToe.play(1, 2); // O
  ticTacToe.play(2, 2); // X
  String actual = ticTacToe.play(1, 3); // O
  assertEquals("O is the winner", actual);
}

The player wins when the whole vertical line is occupied by his pieces.
主站蜘蛛池模板: 麻阳| 建始县| 灵武市| 东乡县| 郯城县| 安远县| 高阳县| 芜湖市| 浦江县| 卓资县| 陵水| 巨鹿县| 古交市| 页游| 宣汉县| 宁安市| 时尚| 华池县| 仲巴县| 四川省| 全椒县| 禹州市| 洛浦县| 安阳县| SHOW| 蓬莱市| 拉萨市| 金山区| 武定县| 西丰县| 博兴县| 历史| 邳州市| 松阳县| 屯昌县| 大厂| 清镇市| 托克逊县| 响水县| 太湖县| 嘉祥县|