Convert this ```. . . . . . . . . . . . . . . . . . . . . 6 5 1 . . . . . . X . 2 3 . . . . . . . 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X)+ . . . . .``` to this followed by the SGF representation of the position.

# Presentation of ascii Go diagrams

### Introduction

Here is a Go diagram using ascii:
```
. . o # o # # # o
# o o # o . # . o
# # . # o o o o o
# # # # # # # # #
# # o o o o o o o
# o . . . . . . .
# o . o . . . o .
# o . . . . . . .
# o . . . . . . .
```
It is readable, but not attractive. If you have either
an ascii Go diagram
or
the URL of a page which contains one or more <goban>-delimited ascii Go diagrams
you can use this page to convert it so that it looks like this:

followed by the SGF representation of the position:

```(;GM[1]
FF[4]
AP[go-utils.pl:1.6]
US[Toni Cornelissen (toni@dse.nl)]
SZ[9]
PL[]
)```

### Diagram conversion

Edges:
top
left right
bottom
Coordinates:
top
left right
bottom

#### Paste or type an ascii diagram in this box:

Note that the amount of white space is important.

Note also that two-character items, such as O\ and 12, cover the dot and the FOLLOWING space.

To play: (colour for odd-numbered stones)
Stone size:
Pixels Artist
15 – transparent Andrew Grant & Nick Wedd
15 – white Andrew Grant
19 – white "
27 – white "
39 – white "
55 – white "

### How to prepare diagrams for conversion

A diagram looking like this:
```>> . X .    This is a comment
>> . X .
>> . O\O
```
is converted to one like this:

The symbols you can use are
symbolmeaning
.
X   x   #
O   o   0
,   +   *
O<   O]   O)   O\
#<   #]   #)   #\
.<   .]   .)   .\
17
18
a   b   c   P   Q   R
The close-bracket characters > ] ) \ must be immediately followed by the next character, with no intervening space.

There are controls to decide:

• Which edges of the diagram are to be shown as board edges
• Whose move it is (if Black's, odd numbers will be shown as black stones and even as white; and vice versa)
• Which set of gifs to use

Within the diagram, line ends denote ends of lines, so you should avoid blank lines.

### Page conversion

A general link to any page with <goban> tags, using the "post" method.
URL to display:
Stone size:
Pixels Artist
15 — transparent Andrew Grant & Nick Wedd
15 — white Andrew Grant
19 — white "
27 — white "
39 — white "
55 — white "
user-specified below
Images to use:
Specify the URL of a directory of suitable images. Include the final /.
Possibilities which you can cut and paste to test this (the scond one is to test the addition of coordinates):
• http://www.maproom.co.uk/thousand.html
• http://www.maproom.co.uk/thousanda.html

### How to write a page suitable for conversion

Go diagrams on your page should look like this:
```<pre><goban edges=lbr>
. . . . . . . . . . . . . . . . . . .
. . . . . . . o o o o o o . . . . . .
. . . , . . o . . , . . . o . , . . .
. . o o o . o x x x x x x o . o o o .
. o . . . . o x . o o o x o . . . . .
. . x x x x x o o . . o o x x x x x .
</goban></pre>
```
which will be converted to look like this:

The arguments to the goban tag are all optional. They decide:

• edges
Which edges of the diagram are to be shown as board edges.
The letters in the parameter value string may be
• n or t   North or Top edge
• w or l   West or Left edge
• s or b   South or Bottom edge
• e or r   East or Right edge
• labels
Which edges of the diagram are to be labelled with coordinates.
The letters in the parameter value string may be
• n or t   North or Top edge
• w or l   West or Left edge
• s or b   South or Bottom edge
• e or r   East or Right edge
• size
Which set of gifs to use.
Possibilities on the same server as the scripts are:
• 15   Andrew/Nick's 15*15 gifs with transparent backgrounds
• 19   Andrew's 19*19 gifs
• 27   Andrew's 27*27 gifs
• 39   Andrew's 39*39 gifs
• 55   Andrew's 55*55 gifs
• images
What set of gifs to use.
This will be ignored if size is specified. It should be the absolute URL, including the final backslash, of a directory containing a suitable set of gifs, e.g. http://www.weddslist.com/g/ag15/ (this is Andrew's set of 15x15 gifs with white backgrounds)
• pl
Which player is to move next.
Possible values are
• B   Black. Odd stones are black, even ones are white.
• W   White. Odd stones are white, even ones are black.
The symbols you can use in the diagram are listed above.

Within the diagram, line ends denote ends of lines, so you should avoid blank lines.

Some example <goban> tags are:

<goban>
The default. No edges on the board. Uses Nick's gif set.

<goban edges=lbrt size=15>
An edge round the board. Uses Andrew's 15x15 gif set.

<goban edges=lt size=39 pl=w>
Top left corner of a board. Uses Andrew's 39x39 gif set. Odd-numbered stones are white, even black.

<goban edges=lt images=http://www.weddslist.com/g/39/ pl=w>
Same effect as above.

### How to link to such pages

If you would normally link to a page like this:
you can instead give a link which uses the script (implicitly using the "get" method), like this
(Note the confusing combination of single and double quotation marks, used by an old version of the script, is no longer necessary.

If you would normally link to a page with an anchor like this:
you can instead give a link which uses the script (using the "get" method), like this

For some servers it may be possible to omit some of the quotation marks. For others, the exact use of '' and "", with the "" within the '', is necessary. I know that it is not possible for this to be server-dependent – I am telling it to you because I have found it to be true, not because it makes any sense.

### Source of scripts

The scripts themselves are available, under the terms of the GNU General Public License: or download them all at once as all.zip

### Credits

The original idea of a cgi script to present go positions nicely was due to Nick Wedd. He presented this idea, and a prototype, in rec.games.go.

This idea was taken up by Toni Cornelissen. He rewrote the scripts, making them more robust and more flexible, and adding many new features, including SGDF output. Nick then copied Toni's scripts and made minor changes which he thought were improvements.

A few of the graphics, the twelve basic ones in the "Andrew Grant & Nick Wedd" gif set, were created by Nick Wedd. All the graphics in the "Andrew Grant" gif sets were created by Andrew Grant. Nick took most of the graphics from Andrew's 15x15 gif set, added transparency to them, and put them with his own gif set.

### Alternatives

If you find that the methods described on this page for presenting a Go diagram are not suitable, some other methods are described here.

Among these, my own preference is was for Simon Goss's program GoFigs. Unfortunately GoFigs is not supported by recent (after about 2010) computer ssystems.