File tree Expand file tree Collapse file tree
exercises/practice/connect Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 "authors" : [
33 " kkyb123"
44 ],
5+ "contributors" : [
6+ " thibault2705"
7+ ],
58 "files" : {
69 "solution" : [
710 " src/main/java/Connect.java"
Original file line number Diff line number Diff line change @@ -30,6 +30,12 @@ description = "nobody wins crossing adjacent angles"
3030[cd61c143-92f6-4a8d-84d9-cb2b359e226b ]
3131description = " X wins crossing from left to right"
3232
33+ [495e33ed-30a9-4012-b46e-d7c4d5fe13c3 ]
34+ description = " X wins with left-hand dead end fork"
35+
36+ [ab167ab0-4a98-4d0f-a1c0-e1cddddc3d58 ]
37+ description = " X wins with right-hand dead end fork"
38+
3339[73d1eda6-16ab-4460-9904-b5f5dd401d0b ]
3440description = " O wins crossing from top to bottom"
3541
Original file line number Diff line number Diff line change @@ -156,6 +156,50 @@ public void xWinsCrossingFromLeftToRight() {
156156
157157 }
158158
159+ @ Disabled ("Remove to run test" )
160+ @ Test
161+ @ DisplayName ("X wins with left-hand dead end fork" )
162+ public void xWinsWithLeftHandDeadEndFork () {
163+
164+ //GIVEN
165+ var board = new String []{
166+ ". . X ." ,
167+ " X X . ." ,
168+ " . X X X" ,
169+ " O O O O"
170+ };
171+ Connect cut = new Connect (board );
172+
173+ //WHEN
174+ var winner = cut .computeWinner ();
175+
176+ //THEN
177+ assertThat (winner ).isEqualTo (Winner .PLAYER_X );
178+
179+ }
180+
181+ @ Disabled ("Remove to run test" )
182+ @ Test
183+ @ DisplayName ("X wins with right-hand dead end fork" )
184+ public void xWinsWithRightHandDeadEndFork () {
185+
186+ //GIVEN
187+ var board = new String []{
188+ ". . X X" ,
189+ " X X . ." ,
190+ " . X X ." ,
191+ " O O O O"
192+ };
193+ Connect cut = new Connect (board );
194+
195+ //WHEN
196+ var winner = cut .computeWinner ();
197+
198+ //THEN
199+ assertThat (winner ).isEqualTo (Winner .PLAYER_X );
200+
201+ }
202+
159203 @ Disabled ("Remove to run test" )
160204 @ Test
161205 @ DisplayName ("O wins crossing from top to bottom" )
You can’t perform that action at this time.
0 commit comments