Learn the Game of Go

Initializing live version
Download to Desktop

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

This Demonstration illustrates the Asian game of Go (also known as Igo, Weiqi, or Baduk). It can be used as a board for two people to play Go, or for teaching and learning the basic rules and concepts.


Click the board to add black or white stones. Change the size of the board by selecting its side length in the third popup menu and clicking the "new board" checkbox. Use the second popup menu to show the "groups", "liberties", "kifu", or "enclosed territory" of the board configuration. These concepts are briefly explained in the details.


Contributed by: José Luis Gómez-Muñoz (March 2011)
Open content licensed under CC BY-NC-SA



In the game of Go, two players alternate in placing black and white stones on a ruled board, with the aim of surrounding more territory than their opponent. Stones are placed at the intersections of the vertical and horizontal lines. Those intersections are also called points. Stones are never moved on the board; they are removed if they are completely surrounded by enemy stones.

Vertically and horizontally adjacent stones of the same color form a group. Two stones that are diagonally adjacent are not connected (unless they are connected by a sequence of other stones of the same color). The empty points that are horizontally and vertically adjacent to a group of stones are known as "liberties" or "breathing spaces". Snapshot 1 reproduces an image from reference [1] that shows two groups. Select "liberties" in the second popup menu to show the liberties of each group. Verify that the group in the top right of snapshot 1 has 12 liberties, while the other group has 15 liberties.

A group of stones is captured (removed) when all of its liberties are occupied by enemy stones. Snapshots 2 and 3 reproduce images from reference [2], showing the capture of a two-stones group at the bottom of the board. This time the second popup menu has the "kifu" option selected, therefore each stone shows the order in which it was placed on the board. The two-stones group at the bottom of the board in snapshot 2 is in danger (atari) of being captured, because it has only one liberty. Snapshot 3 shows the resulting configuration when black plays a stone at the bottom right of the board, capturing and removing the group.

This Demonstration includes rules that forbid "suicide" and "eternity". A player may not "commit suicide", that is, play a stone into a position where it would have no liberties or form part of a group which would have no liberties, unless, as a result, one or more of the enemy stones surrounding it is captured. Therefore, white cannot play a stone on the lower left corner of the board configuration shown in snapshot 3. However, she can play in the upper right corner, because as a result she captures a black stone that gives her stone one liberty. Furthermore, players are not allowed to make a move that returns the game to the position before the opponent's last move. This rule, called the "ko" (eternity) rule, prevents unending repetition.

Instead of placing a stone, a player may pass. When both players pass consecutively, the game ends and is then scored. There are two essentially equivalent scoring systems used to determine the winner at the end of a game, the Chinese system and the Japanese system. It usually does not matter which system is used: in the large majority of the games the same player will win. This Demonstration uses the Chinese system, which is easier to visualize on the board because it does not take into account the number of stones that have been removed. In this system, the score of each player is calculated by adding the number of stones she has on the board plus the number of empty points that are enclosed by her stones. Select "enclosed territory" in the second popup menu to show enclosed points, as shown in snapshots 4 and 5.

The game of Go has a handicap system where a weaker player may be given an initial advantage of anything up to nine stones. There is an established pattern for the placement of handicap stones, shown by the dots which are marked on any Go board (see snapshot 6 and reference [1]).

The kifu (stones with numbers indicating the order in which they were placed on the board) shown in the large thumbnail image is a slight modification of a kifu in reference [3]. This Demonstration reports the score in the same format as the program in reference [4]. More information about the game of Go can be found in [5].


[1] British Go Association, "How to play Go."

[2] J. Tromp, "Tutorial on the Rules of Go."

[3] Club de Go PUV, "Kifus."

[4] A. van der Loeff, "TurboGo for Windows."

[5] American Go Association.

Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.