Sha256: 06a478c413092b6264f75dee1a4723dcff752fcd63de5b4f2072bb4c417f14ab

Contents?: true

Size: 1.09 KB

Versions: 18

Compression:

Stored size: 1.09 KB

Contents

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):

```        
. 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.

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
trackler-2.1.0.18 common/exercises/connect/description.md
trackler-2.1.0.17 common/exercises/connect/description.md
trackler-2.1.0.16 common/exercises/connect/description.md
trackler-2.1.0.15 common/exercises/connect/description.md
trackler-2.1.0.14 common/exercises/connect/description.md
trackler-2.1.0.13 common/exercises/connect/description.md
trackler-2.1.0.12 common/exercises/connect/description.md
trackler-2.1.0.11 common/exercises/connect/description.md
trackler-2.1.0.10 common/exercises/connect/description.md
trackler-2.1.0.9 common/exercises/connect/description.md
trackler-2.1.0.8 common/exercises/connect/description.md
trackler-2.1.0.7 common/exercises/connect/description.md
trackler-2.1.0.6 common/exercises/connect/description.md
trackler-2.1.0.5 common/exercises/connect/description.md
trackler-2.1.0.4 common/exercises/connect/description.md
trackler-2.1.0.3 common/exercises/connect/description.md
trackler-2.1.0.2 common/exercises/connect/description.md
trackler-2.1.0.1 common/exercises/connect/description.md