Wikipedia:Sandbox/Game of Go/Manual

From Wikipedia, the free encyclopedia

If you are new to using templates in this manner, don't be intimidated! The templates should be rather straight forward by looking at just one example. However, this manual simply attempts to document all the details.

Template:Go_board

Contents

[edit] Overview

The default 19x19 board format is as follows, and transcludes the Game of Go Template. The templates work by transclusion.

To create a visual default board, there are 362 parameters, each separated by a "|". Ie. two parameters are " | " and three " | | ". On boards of other sizes, this is equal to the number of positions on the board plus one. All the parameters except for the last one caters for each position (ie. a19, j7, etc.). The last parameter adjusts the size, which is discussed in the formatting section.

In this article, therefore, we will show you examples of blank boards and how to use them to transclude templates of the board in text format, then also show you how they result.

Entering a value tells the template to load the image corresponding to that letter for the section Although it does not matter what rows each parameter is typed in, as the template only recognises the order and values, not the formatting, the example below which one can use for easy modification (and in fact should use for ease of use between players) creates a commented "buffer zone" at the marked by the end of every row, but with most of the comments starting at the beginning til they reach the next "|" separation character. This is due to the fact that anything after the "equals sign" ("=") will be ignored between two separation characters. It is important to preserve the comment. For ease of reference on larger boards, numbers are added in within comments. It is important to realise that although the numbers seem to be similar, they are not - the actual one displayed in the visualisation is from the template and not the actual code transcluding it. It is preferable to keep the commented coordinates in games. Note that on both templates and commented coordinates, the letter "i" is removed and replaced at "s" which is appended at the end and the rest of the letters after it frameshifted to the left.

For initial one-letter image transclusion, entering "b" renders a black seed. Whitespace by itself, or nothing entered in a parameter renders an empty square, while "x" renders an empty star point. "w" renders a white seed. Although multiple whitespaces are ignored, individual whitespaces (with other characters) are not, so be careful. As of recently, there are more advanced ways of calling up further pieces, but these are mainly for analysis of moves in articles, with limited scope in games. This one letter transclusion is fairly straightforward and should be the ones used in games. For instructions on using two letter image transclusions see below. For details, see Letter transclusion.

The number at the lower right corner, the last value controls the image size. It should stay at 30 however, otherwise it begins to fragment because of the coordinates. You can lower it down to 20. Smaller image sizes will have to use no coordinates for now, which is available at Template:Game of Go Position NC, or for smaller board sizes an appended "NC" at the end of the template name. For the full list of templates, see List of Templates. For explanations and examples on how to use them, see sizes

[edit] Model Example

transcluding the following code, (which games should use)...


{| style="margin:1em;"
| style="border: solid thin; padding: 2px;" |
{{Game of Go Position|=
 19 | | | | | | | | | | | | | | | | | | | |=
 18 | | | | | | | | | | | | | | | | | | | |=
 17 | | | | | | | | | | | | | | | | | | | |=
 16 | | | |x| | | | | |x| | | | | |x| | | |=
 15 | | | | | | | | | | | | | | | | | | | |=
 14 | | | | | | | | | | | | | | | | | | | |=
 13 | | | | | | | | | | | | | | | | | | | |=
 12 | | | | | | | | | | | | | | | | | | | |=
 11 | | | | | | | | | | | | | | | | | | | |=
 10 | | | |x| | | | | |x| | | | | |x| | | |=
 9  | | | | | | | | | | | | | | | | | | | |=
 8  | | | | | | | | | | | | | | | | | | | |=
 7  | | | | | | | | | | | | | | | | | | | |=
 6  | | | | | | | | | | | | | | | | | | | |=
 5  | | | | | | | | | | | | | | | | | | | |=
 4  | | | |x| | | | | |x| | | | | |x| | | |=
 3  | | | | | | | | | | | | | | | | | | | |=
 2  | | | | | | | | | | | | | | | | | | | |=
 1  | | | | | | | | | | | | | | | | | | | |=
     a b c d e f g h j k l m n o p q r s t  
|20}}
|-
| style="text-align:center" | 
|}

Renders


19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
a b c d e f g h j k l m n o p q r s t


[edit] Letter transclusion

There are two naming conventions meant to run concurrently, the simpler first single-letter transclusion one, being advised for more use in WikiGames or simpler analysis, and with the second convention, two letter transclusion, for more detail. In a single use of a template, there might be use of both, but this is discouraged because of the lack of aesthetics during editing.

[edit] One Letter transclusion

This type of transclusion is called single letter because only a single character as a paramater is required to transclude the image when used in conjunction with a template. The filenames of the images transcluded with single character parameters will be in the format weiqi-mn.PNG where:

  • m is whether is black, white, empty starpoint or plain empty (in the case of empty there will be no character or space, to allow for easy template use) - w for white, b for black, nothing for plain empty, x for empty starpoint.
  • n whether its a corner, middle, side position, etc, and is
    • md when its in the middle of the board, or at least not at the border
    • ca if it is the upper left corner
    • cb if its the upper right corner
    • cc if its the lower right corner
    • cd if its the lower left corner
    • sl if its the left side border
    • sr if its the right side border
    • st if its the top side border
    • sd if its the down side border

Within the standard templates, typing "x", "w", "b" or whitespace within the parameters yields the approprate piece on the approriate square, ie. typing "w" the upper right hand corner square yields "Weiqi-wcb.PNG", while typing it on the left hand side yields "Weiqi-wsl.PNG" Bear in mind there are no images for star points on the egde of the board (there shouldn't be anyway), so typing "x" on the edges of the board will yield an error.

[edit] Two Letter transclusion

This is called two letter because it uses two characters in a parameter to transclude a certain image. Like above, the template using these images is adaptive, typing the two characters in different parts of a board yield different images. However, the range of use is extended to use of special denotations such as triangles and numbers to specify individual pieces.

The naming convention is as follows - the filenames are called weiqi-mnq.PNG where:

  • m is whether is black, white, empty starpoint or plain empty (in the case of empty there will be no character or space, to allow for easy template use) - w for white, b for black, nothing for plain empty, x for empty starpoint. It also may be used for special symbols such as triangles, move highlighting or similar.
  • n is a specialisation of m. It has the same result as using m and q as variables for the filename in the single letter naming convention, except with writing superimposed for analysis in boards. The letter l in the case of n is reserved for two letter incidences of otherwise single letter transclusion images. For example, xl will have the same effect as "x", except for keeping the editing alignment, which is the purpose of thus extending a two letter version.
  • q whether its a corner, middle, side position, etc, and is
    • md when its in the middle of the board, or at least not at the border
    • ca if it is the upper left corner
    • cb if its the upper right corner
    • cc if its the lower right corner
    • cd if its the lower left corner
    • sl if its the left side border
    • sr if its the right side border
    • st if its the top side border
    • sd if its the down side border

Again, although typing just "x" or "b" or "w" as such may work, this will force the board to be out of alignment with usage of two letter transclusion. It is preferable in this case to type "xl", "wl", "bl" or whitespace within the parameters to yield the same piece on the approriate square, and again typing "wl" the upper right hand corner square yields "Weiqi-wlcb.PNG", and it follows while typing it on the left hand side yields "Weiqi-wlsl.PNG". Again, there are no images for star points on the egde of the board, so typing "xl" on the edges of the board will yield an error.

However, the list of extended functions include, to specify individual pieces on the board for analysis in articles: typing either "w1" and "b1" within the parameter, would yield either a white peace bearing the number "1" superimposed on it, or a black piece, respectively. "w2" and "b2", likewise would yield the same effect for "2", and this continues up to the number 9. This only works for white and black pieces - "x1", will yield an error, for xample. To denote a piece with a triangle, either "wT" or "bT" is used to show a triangle icon on top of a white or black piece respectively. Again, both triangle and numerical icons on top of the pieces are adapted to the various positions of the board.

[edit] Example of Two Letter transclusion


{| style="margin:1em;"
| style="border: solid thin; padding: 2px;" |
{{Template:Game of Go Position|=
 19 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |=
 18 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |=
 17 |  |  |b1|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |=
 16 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |=
 15 |  |  |  |w2|  |  |  |  |  |xl|  |  |  |  |  |xl|  |  |  |=
 14 |  |b3|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |=
 13 |  |  |  |w4|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |=
 12 |  |  |  |  |  |  |  |bl|  |  |  |  |  |  |  |  |  |  |  |=
 11 |  |  |  |  |  |wl|  |  |  |  |  |  |  |  |  |  |  |  |  |=
 10 |  |  |  |  |  |  |  |  |  |  |wT|  |  |  |  |  |  |  |  |=
  9 |  |  |  |xl|  |  |  |  |  |xl|  |  |  |  |w6|w8|  |  |  |=
  8 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |b5|  |  |  |=
  7 |  |  |  |  |  |  |  |  |  |  |bT|  |  |b9|  |  |  |  |  |=
  6 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |b7|  |  |=
  5 |  |  |  |  |wl|  |  |  |  |  |  |  |  |  |  |  |  |  |  |=
  4 |  |  |  |xl|  |bl|wl|  |  |xl|  |  |  |  |  |xl|  |  |  |=
  3 |  |  |  |bl|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |=
  2 |  |  |  |  |  |bl|  |  |  |  |  |  |  |  |  |  |  |  |  |=
  1 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |= 
     a  b  c  d  e  f  g  h  j  k  l  m  n  o  p  q  r  s  t   
|20}}
|-
|}


19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
a b c d e f g h j k l m n o p q r s t


[edit] Board Sizes

Different templates for different sizes exist to cater to the different needs of games and articles. We've written templates for the default 3, 9x9, 13x13 and 19x19, although we will add additional templates if you wish. Generally, the templates can be transcluded by transcluding the respective template using 82 (bear in mind the extra parameter is for the icon size), 170 and 362 parameters respectively, and each parameter save for the last will correspond to a piece (or lack thereof) on a position whose order runs from left to right at the start of every row. There also exists quarter and middle boards, designed mainly for analysis use. Formatting is encouraged.

For convenience, ease of use, or just plain aesthetics, the different board sizes are demonstrated below, bearing in mind again, "i" has been replaced and letters in front of its former position frameshifted back:

[edit] 9x9

A single letter transclusion version: the parameters have simply been truncated from 19x19 and reformatted to suit the template:


{| style="margin:1em;"
| style="border: solid thin; padding: 2px;" |
{{Template:Game of Go Position 9x9|=

 9 | | | | | | | | | |=
 8 | | | | | | | | | |=
 7 | | |x| | | |x| | |=
 6 | | | | | | | | | |=
 5 | | | | |x| | | | |=
 4 | | | | | | | | | |=
 3 | | |x| | | |x| | |=
 2 | | | | | | | | | |=
 1 | | | | | | | | | |=
    a b c d e f g h j   

|30}}
|-
| style="text-align:center" |
|}

And a double letter transclusion version:


{| style="margin:1em;"
| style="border: solid thin; padding: 2px;" |
{{Template:Game of Go Position 9x9|=

 9 |  |  |  |  |  |  |  |  |  |=
 8 |  |  |  |  |  |  |  |  |  |=
 7 |  |  |xl|  |  |  |xl|  |  |=
 6 |  |  |  |  |  |  |  |  |  |=
 5 |  |  |  |  |xl|  |  |  |  |=
 4 |  |  |  |  |  |  |  |  |  |=
 3 |  |  |xl|  |  |  |xl|  |  |=
 2 |  |  |  |  |  |  |  |  |  |=
 1 |  |  |  |  |  |  |  |  |  |=
    a  b  c  d  e  f  g  h  j   

|30}}
|-
| style="text-align:center" |
|}

Both yield:

9
8
7
6
5
4
3
2
1
a b c d e f g h j


[edit] 13x13

A single letter transclusion version: the parameters have again simply been truncated from 19x19 and reformatted to suit the template, except this time for 13:


{| style="margin:1em;"
| style="border: solid thin; padding: 2px;" |
{{Template:Game of Go Position 13x13|=
 13 | | | | | | | | | | | | | |=
 12 | | | | | | | | | | | | | |=
 11 | | | | | | | | | | | | | |=
 10 | | | |x| | | | | |x| | | |=
  9 | | | | | | | | | | | | | |=
  8 | | | | | | | | | | | | | |=
  7 | | | | | | | | | | | | | |=
  6 | | | | | | | | | | | | | |=
  5 | | | | | | | | | | | | | |=
  4 | | | |x| | | | | |x| | | |=
  3 | | | | | | | | | | | | | |=
  2 | | | | | | | | | | | | | |=
  1 | | | | | | | | | | | | | |=
     a b c d e f g h j k l m n 
|30}}
|-
|}

A two letter transclusion version for aesthetic edits is:



{| style="margin:1em;"
| style="border: solid thin; padding: 2px;" |
{{Template:Game of Go Position 13x13|=
 13 |  |  |  |  |  |  |  |  |  |  |  |  |  |=
 12 |  |  |  |  |  |  |  |  |  |  |  |  |  |=
 11 |  |  |  |  |  |  |  |  |  |  |  |  |  |=
 10 |  |  |  |xl|  |  |  |  |  |xl|  |  |  |=
  9 |  |  |  |  |  |  |  |  |  |  |  |  |  |=
  8 |  |  |  |  |  |  |  |  |  |  |  |  |  |=
  7 |  |  |  |  |  |  |  |  |  |  |  |  |  |=
  6 |  |  |  |  |  |  |  |  |  |  |  |  |  |=
  5 |  |  |  |  |  |  |  |  |  |  |  |  |  |=
  4 |  |  |  |xl|  |  |  |  |  |xl|  |  |  |=
  3 |  |  |  |  |  |  |  |  |  |  |  |  |  |=
  2 |  |  |  |  |  |  |  |  |  |  |  |  |  |=
  1 |  |  |  |  |  |  |  |  |  |  |  |  |  |=
     a  b  c  d  e  f  g  h  j  k  l  m  n 
|30}}
|-
|}

Both which yield:


13
12
11
10
9
8
7
6
5
4
3
2
1
a b c d e f g h j k l m n


[edit] 19x19

19x19 is default. See the model example. For an example of a two letter transclusion 19x19 board, see the example of two letter transclusion.

[edit] List of Templates

This is the list of templates which generally follow the principles outlined in this manual.

Note: this article only involves the method to use the templates. To make suggestions concerning the templates, see the Template Talk Page. Specific questions not answered here concerning use can be posted at this article's talk page.