How Diagrams Work
![[Diagram]](../../diagrams/19/03e88c6bc442244ab406309e7aab5a5a.png)
A taisha variation
Diagrams make discussing Go much easier. Don't worry! They are quite easy to use.
SGF files are generated automatically from diagrams. Clicking on a diagram will download the corresponding SGF file. You may wish to examine some of these diagrams with your favorite SGF editor.
As you read these instructions, it will be helpful to open Edit page in a second window to see what's under the hood. Before closing it, please press cancel.
Basics
$$ A [taisha] variation $$ ------------------ $$ | . . . . . . . . . $$ | . . . . . . . . . $$ | . . 7 3 X d . . . $$ | . . O 1 O 6 . . . $$ | . . 4 2 5 c . . . $$ | . . 8 X a . . . . $$ | . . . b . . . . . $$ | . . . . . . . . . $$ | . . . . . . . . .
All diagram lines start with two dollar signs ("$$").
The title of the diagram goes on the first line, separated from the dollar signs by a space (" ").
The rest of the lines describe the board. The syntax used is similar to that commonly used in newsgroups and email:
- A dot (".") is an empty intersection.
- "X" is a black stone and "O" is a white stone.
- A comma (",") is a hoshi (star point).
- Edges are marked with any of "|", "+" and "-".
Moves
You can represent a sequence of moves with the numbers 1-9 and 0 (0 represents move 10). You can only have ten moves (1 through 10) in one diagram[3].
By default, move 1 and all odd-numbered moves are black, and all even-numbered moves are white. You can reverse this by putting "W" after the dollar signs on the first line: "$$W". Using "B" makes explicit the default behavior of Black going first. Think of a line beginning with "$$B" as meaning "Black to play."
If two moves are made at the same intersection, put the second move in the diagram's title in the form "a at b" (for example, "5 at 1"). This causes the move to be included in the generated SGF file.
Markup
Diagrams can contain markup, and then be referred to in the text:
In In Appears Meaning Diagram Text as -------------------------------------------------------- X BOplain black stone O WO
plain white stone 1..9 B1,W2
,
Black's move 1, White's move 2 [3] 0 (zero) B10,W10
,
Black's or White's move 10 [3] B BC
black stone with circle W WC
white stone with circle # BS
black stone with square @ WS
white stone with square C EC
circle on empty intersection S ES
square on empty intersection a..z a..z a..z letter on empty intersection
Coordinate markers and board size
You can cause a diagram to show coordinate markers by putting "c" after the dollar signs on the first line: "$$c". The "c" must follow the color indicator ("B" or "W"), if present: "$$Bc".
The diagram must show at least two perpendicular edges for the coordinate markers to appear.
If the diagram shows an entire board (that is, it shows all four edges), then its size will be calculated automatically. You can specify a size for a partial board by placing it after the dollar signs on the first line: "$$13". The size must follow the color indicator and "c", if present: "$$B13", "$$c13" or "$$Bc13". Without an explicit size, a partial board will be assumed to be 19x19.
Note that the coordinate markers on the left of the example diagram go to 13 rather than 19.
Comparison diagrams
Use _ to make separator in the diagram. Press "edit page" button to look in details.
Links in diagrams
Syntax:
$$ [ MarkupCharacter | PageName ]
Just add lines like the upper one at the bottom of a diagram to create a link between a marked stone/point and a page.
- MarkupCharacter
- is the same character used on the board itself.
- PageName
- is any name, external link, or local name.
[2] Examples:
The following diagram contains three examples for links. It is the result of the code to the right.
$$ Links in diagrams - examples $$ -------------- $$ | . . . . . . . $$ | . C . . . . . $$ | . . . 1 6 . . $$ | . . 5 4 . . . $$ | . . 3 2 . . . $$ | . . a . . C . $$ | . . . . . . . $$ [2|NadareJoseki] [21] $$ [a|http://gtl.xmp.net/members/info?p_key=349] [22] $$ [C|#1] [23]
[21] links to the page called NadareJoseki.
[22] links a to Arno's GTL info.
[23] links all the circled points to the footnote called [#1].
Works with every kind of markup and with marked stones. Does not work with plain stones or on the empty board.
Stones in Text
In text, you can refer to stones like this:
- B1, W2 ... W10, BC, BS, BO, WC, WS, WO, ES, EC
This will appear like this:
-
,
...
,
,
,
,
,
,
,
,
You can suppress the special meaning of these words by preceeding them with an exclamation mark: i.e. !BC gives BC.
Other information
Diagrams that are shown when previewing edits look different from the normal diagrams you see in pages. See on-the-fly diagram.
Sensei's Library has a tool that generates a diagram from an SGF file. (A link to the tool is also given when you edit a page).
In order to set up a game position yourself, you may copy the diagram from the bottom of any edit page, or at Corner diagram for a corner position.
For odd board shapes, look at Creating Irregular Gobans With Wiki.
Utilities
- HolIgor has made a tool that generates a Sensei's Library-style diagram from a text diagram such as is produced by WinMGT. See WinMGT to SLF converter.
- Kombilo also has a feature which allows diagram export for SL. Choose File > Export Current Position > Wiki Mode (check box).
This directly produces diagrams in SL format.
- Drago enables to select a rectangular area on the go board and export it to some formats including SL ASCII format, see SL Diagrams with Drago.
- SmartGo can export diagrams to ASCII format: Choose Edit > Copy as ASCII to create a diagram of the current board position. Choose Tools > Options > Edit and turn on Wiki format to produce the correct format for Sensei's Library. Choose View > Partial Board to select a rectangular area of the board.
Discussion
If you are in edit-mode and scroll down the window you will see that we have put two diagrams there for you to copy & paste. Also, there's a quick help included as well. Any questions left?
[1] - This is the footnote referred to in the example diagram above [2].
[3] - Sorry! 10 moves ( 1 .. 0 become 1 through 10) is the maximum in one diagram. Inserting other numbers will not work. If you want a diagram with more than 10 moves in it, you can use a self made image hosted on another site(see HowToAddImages) or use several diagrams, splitting the moves through them(see OngoingGame1 for an example).