# Connect Compute the result for a game of Hex / Polygon. The abstract boardgame known as [Hex](https://en.wikipedia.org/wiki/Hex_%28board_game%29) / Polygon / CON-TAC-TIX is quite simple in rules, though complex in practice. Two players place stones on a rhombus with hexagonal fields. The player to connect his/her stones to the opposite side first wins. The four sides of the rhombus are divided between the two players (i.e. one player gets assigned a side and the side directly opposite it and the other player gets assigned the two other sides). Your goal is to build a program that given a simple representation of a board computes the winner (or lack thereof). Note that all games need not be "fair". (For example, players may have mismatched piece counts.) The boards look like this (with spaces added for readability, which won't be in the representation passed to your code): ```text . O . X . . X X O . O O O X . . X O X O X O O O X ``` "Player `O`" plays from top to bottom, "Player `X`" plays from left to right. In the above example `O` has made a connection from left to right but nobody has won since `O` didn't connect top and bottom. ## Getting Started For installation and learning resources, refer to the [exercism help page](http://exercism.io/languages/haskell). ## Running the tests To run the test suite, execute the following command: ```bash stack test ``` #### If you get an error message like this... ``` No .cabal file found in directory ``` You are probably running an old stack version and need to upgrade it. #### Otherwise, if you get an error message like this... ``` No compiler found, expected minor version match with... Try running "stack setup" to install the correct GHC... ``` Just do as it says and it will download and install the correct compiler version: ```bash stack setup ``` ## Running *GHCi* If you want to play with your solution in GHCi, just run the command: ```bash stack ghci ``` ## Feedback, Issues, Pull Requests The [exercism/haskell](https://github.com/exercism/haskell) repository on GitHub is the home for all of the Haskell exercises. If you have feedback about an exercise, or want to help implementing a new one, head over there and create an issue. We'll do our best to help you! ## Submitting Incomplete Solutions It's possible to submit an incomplete solution so you can see how others have completed the exercise.