State of Tic-Tac-Toe problem has an incorrect testcase

    test "Finished game where X won via a row and a column victory" do
      board = """
      XXX
      XOO
      XOO
      """

      assert StateOfTicTacToe.game_state(board) == {:ok, :win}
    end

For the above test, the result should have been similar to an error state as described by the last test because a row and column victory isn’t possible at the same time in a turn

test "Invalid board: X won and O kept playing" do
      board = """
      XXX
      OOO
      ...
      """

      assert StateOfTicTacToe.game_state(board) ==
               {:error, "Impossible board: game should have ended after the game was won"}
    end

Why not? :slight_smile:

 XX
XOO
XOO

yeah, now I just feel stupid for not seeing that. Thanks for the reply

1 Like

Never feel stupid - we all get things wrong! :slight_smile: But framing things as questions not assertions tends to get more positive responses in this community - millions of people solve these exercises - better to explore together than to presume they’re wrong :slight_smile:

1 Like

yes absolutely, I will keep that in mind for next time

1 Like