Sha256: 2c0940c0b520159f8ab203f954a28df77f8f7020d993d03a3260f1409451060f

Contents?: true

Size: 1.16 KB

Versions: 67

Compression:

Stored size: 1.16 KB

Contents

Count the scored points on a Go board.

In the game of go (also known as baduk, igo, cờ vây and wéiqí) points
are gained by completely encircling empty intersections with your
stones. The encircled intersections of a player are known as its
territory.

Write a function that determines the territory of each player. You may
assume that any stones that have been stranded in enemy territory have
already been taken off the board.

Write a function that determines the territory which includes a specified coordinate.

Multiple empty intersections may be encircled at once and for encircling
only horizontal and vertical neighbours count. In the following diagram
the stones which matter are marked "O" and the stones that don't are
marked "I" (ignored).  Empty spaces represent empty intersections.

```text
+----+
|IOOI|
|O  O|
|O OI|
|IOI |
+----+
```

To be more precise an empty intersection is part of a player's territory
if all of its neighbours are either stones of that player or empty
intersections that are part of that player's territory.

For more information see
[wikipedia](https://en.wikipedia.org/wiki/Go_%28game%29) or [Sensei's
Library](http://senseis.xmp.net/).

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
trackler-2.2.1.139 problem-specifications/exercises/go-counting/description.md
trackler-2.2.1.138 problem-specifications/exercises/go-counting/description.md
trackler-2.2.1.137 problem-specifications/exercises/go-counting/description.md
trackler-2.2.1.136 problem-specifications/exercises/go-counting/description.md
trackler-2.2.1.135 problem-specifications/exercises/go-counting/description.md
trackler-2.2.1.134 problem-specifications/exercises/go-counting/description.md
trackler-2.2.1.133 problem-specifications/exercises/go-counting/description.md
trackler-2.2.1.132 problem-specifications/exercises/go-counting/description.md
trackler-2.2.1.131 problem-specifications/exercises/go-counting/description.md
trackler-2.2.1.130 problem-specifications/exercises/go-counting/description.md
trackler-2.2.1.129 problem-specifications/exercises/go-counting/description.md
trackler-2.2.1.128 problem-specifications/exercises/go-counting/description.md
trackler-2.2.1.127 problem-specifications/exercises/go-counting/description.md
trackler-2.2.1.126 problem-specifications/exercises/go-counting/description.md
trackler-2.2.1.125 problem-specifications/exercises/go-counting/description.md
trackler-2.2.1.124 problem-specifications/exercises/go-counting/description.md
trackler-2.2.1.123 problem-specifications/exercises/go-counting/description.md
trackler-2.2.1.122 problem-specifications/exercises/go-counting/description.md
trackler-2.2.1.121 problem-specifications/exercises/go-counting/description.md
trackler-2.2.1.120 problem-specifications/exercises/go-counting/description.md