## Capture Go

Play against one of our Housebots, or, play against your own bots or your friends bots. The aim of Capture Go is to be the first to capture the target number of stones, or else to have captured the most stones when the game ends by both players passing their turns.

One player will have black stones and the other white stones. The game starts out with an empty board and black goes first.

A place on the board where any two lines meet is called an intersection, and the players take it in turns placing stones on unoccupied intersections. A player can also pass any of their moves, but keep in mind that if both players pass consecutively then the game ends and the winner is the player who has captured the most stones.

A block of stones of the same colour is called a chain. Two (horizontally or vertically) adjacent stones of the same colour are in the same chain. Two non-adjacent stones of the same colour can also be in the same chain if one of them is adjacent to a chain of the other.

On this board the two black stones form a single chain, but the white stones are two separate chains since they are not adjacent to each other.

On this board the five black stones form a single chain, but the white stones are three separate chains of one stone each.

To capture a chain of your opponent's stones you must have stones on every intersection adjacent to that chain. When a chain of stones is captured, those stones are removed from the board.

If it is the white player's turn and they place a stone in position (2, 2) on this board then the chain of three black stones will be captured and we will have the resulting board:

It's possible to place a stone on an intersection such that some of your own stones are captured. Such a move is illegal unless this move also captures enemy stones, and in which case these enemy stones are removed from the board but yours are not.

The winner is the first player to capture at least the target number of stones, or the player who has captured the most stones when both players pass consecutively. A tie is possible if both players pass with the same number of captured stones.

## Full Go

The full game of Go works like Capture Go, except for three things.

One: the game ends either when both players pass consecutively, or there have been a set number of moves (the maximum number of moves allowed; passes count too).

Two: when the game ends the winner is the player with the highest score according to the scoring method of the game (see below for the three scoring methods). The game is a draw if the players have the same score.

Three: there is an additional rule called the ko rule, which says that a player cannot place a stone in a position which would put the board in the exact same state as before.

Consider the board above. If it is black's turn and they place a stone in position (1, 1) then we will end up with the board below. If white were then allowed to play a stone in position (2, 1), this would result in the first board again. Therefore white is forbidden from placing a stone in position (2, 1) on this turn by the ko rule.

## Scoring methods

There are three different scoring methods that can be used:

1. Stone scoring

A player's score is the number of stones they have on the board

2. Territory scoring

A player's score is the number empty intersections that are part of the player's territory. An intersection is part of a player's territory if it is empty and all adjacent intersections are of that player's colour or that player's territory. So then, a 'chain of empty intersections' is part of a player's territory if and only if it is adjacent to a stone of that player and no stones of the other player.

3. Area scoring

A player's score is the stone score plus the territory score. That is, the number of that player's stones on the board plus the number of intersections that are part of the player's territory.

## Useful Links

To start playing, use the links below to get a working example that will let you immediately play a full game of Go then start tweaking the code to add your strategy.