Nodyn:Chess diagram

Oddi ar Wicipedia
Jump to navigation Jump to search
{{{2}}}
Solid white.svga b c d e f g h Solid white.svg
8black kingblack kingblack kingblack kingblack kingblack kingblack kingblack king8
7black kingblack kingblack kingblack kingblack kingblack kingblack kingblack king7
6black kingblack kingblack kingblack kingblack kingblack kingblack kingblack king6
5black kingblack kingblack kingblack kingblack kingblack kingblack kingblack king5
4black kingblack kingblack kingblack kingblack kingblack kingblack kingblack king4
3black kingblack kingblack kingblack kingblack kingblack kingblack kingblack king3
2black kingblack kingblack kingblack kingblack kingblack kingblack kingblack king2
1black kingblack kingblack kingblack kingblack kingblack kingblack kingblack king1
Solid white.svga b c d e f g h Solid white.svg
Documentation icon Dogfennaeth nodyn[gweld] [golygu] [hanes] [puro]

Syntax[golygu cod y dudalen]

There are several standard chess diagram templates:

There are also templates for chess variants:

The syntax is basically the same for all of them.

{{Chess diagram
| <alignment> (param #1)
| <header>    (#2) 
| size =
| numbers =
| letters =
| <a8> | <b8> | ... | <h8>  (#3 to ...
| <a7> | <b7> | ... | <h7>
...
| <a1> | <b1> | ... | <h1>  ( ... #66)
| <footer> (#67)
}}

Parameters:

  • <alignment> – defines horizontal alignment (floating) of the whole table, must be tright or tleft (or nothing)
  • <header> – the text which appears above the diagram, may be empty;
  • size - specifies the size of each square in pixels, the default is 26.
  • numbers - specifies whether the rows are numbered. Options are: left, right, both (default) or neither.
  • letters - specifies whether the columns are lettered. Options are: top, bottom, both (default) or neither.
  • <a8>, <b8>, ... <h1> – define corresponding squares of the chessboard, see below;
  • <footer> – the text which appears beneath the diagram, may be empty; optional – can be left out (currently not in the other templates)

A square is defined by the name of piece or empty parameter. The names of the pieces are those given in algebraic notation:

  • Chess kll45.svg Chess kld44.png Chess kdl44.png Chess kdd45.svg k = king
  • Chess qld44.png Chess qll44.png Chess qdd44.png Chess qdl44.png q = queen
  • Chess rll44.png Chess rld44.png Chess rdl44.png Chess rdd44.png r = rook
  • Chess bld44.png Chess bll44.png Chess bdd44.png Chess bdl44.png b = bishop
  • Chess nll44.png Chess nld44.png Chess ndl44.png Chess ndd44.png n = knight
  • Chess pld44.png Chess pll44.png Chess pdd44.png Chess pdl44.png p = pawn

There are also some fairy chess pieces available:

  • Chess all44.png Chess ald44.png Chess adl44.png Chess add44.png a = archbishop (knight + bishop compound)
  • Chess cld44.png Chess cll44.png Chess cdd44.png Chess cdl44.png c = chancellor (knight + rook compound)
  • Chess fll44.png Chess fld44.png Chess fdl44.png Chess fdd44.png f = upside-down king
  • Chess gld44.png Chess gll44.png Chess gdd44.png Chess gdl44.png g = upside-down queen
  • Chess mll44.png Chess mld44.png Chess mdl44.png Chess mdd44.png m = upside-down rook
  • Chess eld44.png Chess ell44.png Chess edd44.png Chess edl44.png e = upside-down bishop
  • Chess sll44.png Chess sld44.png Chess sdl44.png Chess sdd44.png s = upside-down knight
  • Chess hld44.png Chess hll44.png Chess hdd44.png Chess hdl44.png h = upside-down pawn
  • Chess zll44.png Chess zld44.png Chess zdl44.png Chess zdd44.png z = champion (for Omega Chess)
  • Chess wld44.png Chess wll44.png Chess wdd44.png Chess wdl44.png w = wizard (for Omega Chess)

These letters are combined with either "l" for Light=White, or "d" for Dark=Black. So "kl" is White's king, and "nd" is Black's knight.

An empty square is written either using underscores, spaces, or nothing at all. Two spaces are recommended.

  • Chess d45.svgChess l45.svg <space> = empty square

You can also use "xx" for a cross, "xo" for a black circle on an empty square or "oo" for a white one.

  • Chess xxd45.svgChess xxl45.svg xx = cross/x
  • Chess xod45.svgChess xol45.svg xo = black circle
  • Chess ood44.pngChess ool44.png oo = white circle

Numbers can also be added to squares by using "x0" for 0, "x1" for 1, "x2" for 2, ..., "x9" for 9.

  • Chess x0d45.svgChess x0l45.svg x0
  • Chess x1d45.svgChess x1l45.svg x1
  • Chess x2d45.svgChess x2l45.svg x2
  • Chess x3d45.svgChess x3l45.svg x3
  • Chess x4d45.svgChess x4l45.svg x4
  • Chess x5d45.svgChess x5l45.svg x5
  • Chess x6d45.svgChess x6l45.svg x6
  • Chess x7d45.svgChess x7l45.svg x7
  • Chess x8d45.svgChess x8l45.svg x8
  • Chess x9d45.svgChess x9l45.svg x9

Examples[golygu cod y dudalen]

In the following examples the rows and columns are numbered. Because any text between "|=" and the next "|" is ignored, numbers and letters can be added without affecting output.

Standard diagram[golygu cod y dudalen]

This diagram is recommended for common use as a main diagram in the articles on chess openings, endings, games, positions etc. See the corresponding code below.

Solid white.svga b c d e f g h Solid white.svg
8black rookblack knightblack bishopblack queenblack kingblack bishopblack knightblack rook8
7black pawnblack pawnblack pawnblack pawnblack kingblack pawnblack pawnblack pawn7
6black kingblack kingblack kingblack kingblack kingblack kingblack kingblack king6
5black kingblack kingblack kingblack kingblack pawnblack kingblack kingblack king5
4black kingblack kingblack kingblack kingwhite pawnwhite pawnblack kingblack king4
3black kingblack kingblack kingblack kingblack kingblack kingblack kingblack king3
2white pawnwhite pawnwhite pawnwhite pawnblack kingblack kingwhite pawnwhite pawn2
1white rookwhite knightwhite bishopwhite queenwhite kingwhite bishopwhite knightwhite rook1
Solid white.svga b c d e f g h Solid white.svg
The King's Gambit
{{Chess diagram
| tright
| 
|= 

 8 |rd|nd|bd|qd|kd|bd|nd|rd|=
 7 |pd|pd|pd|pd|  |pd|pd|pd|=
 6 |  |  |  |  |  |  |  |  |=
 5 |  |  |  |  |pd|  |  |  |=
 4 |  |  |  |  |pl|pl|  |  |=
 3 |  |  |  |  |  |  |  |  |=
 2 |pl|pl|pl|pl|  |  |pl|pl|=
 1 |rl|nl|bl|ql|kl|bl|nl|rl|=
    a  b  c  d  e  f  g  h  

| The King's Gambit
}}

Diagram with both captions[golygu cod y dudalen]

W. Langstaff, Chess Amateur 1922
Solid white.svga b c d e f g h Solid white.svg
8black kingblack kingblack kingblack kingblack kingblack kingblack kingblack rook8
7black kingblack kingblack kingblack kingblack kingblack kingblack kingblack king7
6black kingblack kingblack kingblack kingblack kingwhite bishopblack kingwhite pawn6
5black kingblack kingblack kingwhite rookblack kingwhite kingblack pawnwhite pawn5
4black kingblack kingblack kingblack kingblack kingblack kingblack kingblack king4
3black kingblack kingblack kingblack kingblack kingblack kingblack kingblack king3
2black kingblack kingblack kingblack kingblack kingblack kingblack kingblack king2
1black kingblack kingblack kingblack kingblack kingblack kingblack kingblack king1
Solid white.svga b c d e f g h Solid white.svg
Mate in two.
This problem uses partial retrograde analysis method.

It may be convenient to use this in the articles on chess problems. Please note that in the header and footer you can use bolds or italics. You can also use <br> to break the lines.

{{Chess diagram
| tright
| '''W. Langstaff''', ''Chess Amateur'' 1922
|= 

 8 |  |  |  |  |kd|  |  |rd|=
 7 |  |  |  |  |  |  |  |  |=
 6 |  |  |  |  |  |bl|  |pl|=
 5 |  |  |  |rl|  |kl|pd|pl|=
 4 |  |  |  |  |  |  |  |  |=
 3 |  |  |  |  |  |  |  |  |=
 2 |  |  |  |  |  |  |  |  |=
 1 |  |  |  |  |  |  |  |  |=
    a  b  c  d  e  f  g  h  

| '''Mate in two.''' <br> This problem uses ''partial retrograde analysis'' method.
}}

Diagram without captions[golygu cod y dudalen]

Solid white.svga b c d e f g h Solid white.svg
8black kingblack kingblack kingblack kingblack kingblack kingblack kingblack king8
7black kingblack kingblack kingblack kingblack kingblack kingblack kingblack king7
6black kingcrossblack circlecrossblack kingblack kingblack kingblack king6
5black kingblack kingwhite pawnblack kingblack kingblack kingblack kingblack king5
4black kingblack kingblack kingblack kingblack kingblack circleblack kingblack king4
3black kingblack kingblack kingblack kingcrossblack circlecrossblack king3
2black kingblack kingblack kingblack kingblack kingwhite pawnblack kingblack king2
1black kingblack kingblack kingblack kingblack kingblack kingblack kingblack king1
Solid white.svga b c d e f g h Solid white.svg

See the corresponding code below. If you don't want the captions, just remove them, but don't delete the second "|" pipe character for the caption above; it is possible to delete the last pipe for the longer caption below.

The diagram floats to the left to illustrate the use of the first parameter.

{{Chess diagram
| tleft
| 
|= 

 8 |  |  |  |  |  |  |  |  |=
 7 |  |  |  |  |  |  |  |  |=
 6 |  |xx|xo|xx|  |  |  |  |=
 5 |  |  |pl|  |  |  |  |  |=
 4 |  |  |  |  |  |xo|  |  |=
 3 |  |  |  |  |xx|xo|xx|  |=
 2 |  |  |  |  |  |pl|  |  |=
 1 |  |  |  |  |  |  |  |  |=
    a  b  c  d  e  f  g  h  
}}

Small diagram[golygu cod y dudalen]

This one may be useful in articles with many diagrams. It uses another template named {{Chess diagram small}}.

The small diagrams can have header, too.

Nodyn:Chess diagram small

{{Chess diagram small
| tright
| 
|= 

 8 |rd|  |  |qd|  |rd|kd|  |=
 7 |pd|pd|  |  |pd|pd|bd|pd|=
 6 |  |nd|pd|  |  |nd|pd|  |=
 5 |  |  |ql|  |  |  |bl|  |=
 4 |  |  |  |pl|pl|  |bd|  |=
 3 |  |  |nl|  |  |nl|  |  |=
 2 |pl|pl|  |  |  |pl|pl|pl|=
 1 |  |  |  |rl|kl|bl|  |rl|=
    a  b  c  d  e  f  g  h  

| The position after 11. Bg5.
}}

Different board size[golygu cod y dudalen]

Chess boards of non-standard dimensions need special templates. There are templates for the following boards:

Minichess (5×5) – Template:Chess diagram 5x5
{{Chess diagram 5x5
| tright
| 
|= 

 5 |kd|qd|bd|nd|rd|=
 4 |pd|pd|pd|pd|pd|=
 3 |  |  |  |  |  |=
 2 |pl|pl|pl|pl|pl|=
 1 |kl|ql|bl|nl|rl|=
    a  b  c  d  e  

| Gardner minichess
}}

Nodyn:Chess diagram 5x5

Los Alamos chess (6×6) – Template:Chess diagram 6x6
{{Chess diagram 6x6
| tright
| 
|= 

 6 |rd|nd|qd|kd|nd|rd|=
 5 |pd|pd|pd|pd|pd|pd|=
 4 |  |  |  |  |  |  |=
 3 |  |  |  |  |  |  |=
 2 |pl|pl|pl|pl|pl|pl|=
 1 |rl|nl|ql|kl|nl|rl|=
    a  b  c  d  e  f  

| Los Alamos chess
}}

Nodyn:Chess diagram 6x6

Capablanca chess (8×10)
{{Chess diagram 8x10
| tright
| 
|= 

 8 |rd|nd|ad|bd|qd|kd|bd|cd|nd|rd|=
 7 |pd|pd|pd|pd|pd|pd|pd|pd|pd|pd|=
 6 |  |  |  |  |  |  |  |  |  |  |=
 5 |  |  |  |  |  |  |  |  |  |  |=
 4 |  |  |  |  |  |  |  |  |  |  |=
 3 |  |  |  |  |  |  |  |  |  |  |=
 2 |pl|pl|pl|pl|pl|pl|pl|pl|pl|pl|=
 1 |rl|nl|al|bl|ql|kl|bl|cl|nl|rl|=
    a  b  c  d  e  f  g  h  i  j

| Capablanca chess
}}

Nodyn:Chess diagram 8x10

Grand Chess
{{Chess diagram 10x10
| tright
| 
|= 

10 |rd|  |  |  |  |  |  |  |  |rd|=
 9 |  |nd|bd|qd|kd|cd|ad|bd|nd|  |=
 8 |pd|pd|pd|pd|pd|pd|pd|pd|pd|pd|=
 7 |  |  |  |  |  |  |  |  |  |  |=
 6 |  |  |  |  |  |  |  |  |  |  |=
 5 |  |  |  |  |  |  |  |  |  |  |=
 4 |  |  |  |  |  |  |  |  |  |  |=
 3 |pl|pl|pl|pl|pl|pl|pl|pl|pl|pl|=
 2 |  |nl|bl|ql|kl|cl|al|bl|nl|  |=
 1 |rl|  |  |  |  |  |  |  |  |rl|=
    a  b  c  d  e  f  g  h  i  j

| Grand Chess
}}
Nodyn:Chess diagram 10x10

Double boards[golygu cod y dudalen]

Bughouse chess (four players)
{{bughouse chess diagram
| A1=Team 1, Board A 
| A2=Team 2, Board A 
| B1=Team 1, Board B 
| B2=Team 2, Board B
| tright
|
|=
 8 |rd|nd|bd|qd|kd|bd|nd|rd|=
 7 |pd|pd|pd|pd|pd|pd|pd|pd|=
 6 |  |  |  |  |  |  |  |  |=
 5 |  |  |  |  |  |  |  |  |=
 4 |  |  |  |  |  |  |  |  |=
 3 |  |  |  |  |  |  |  |  |=
 2 |pl|pl|pl|pl|pl|pl|pl|pl|=
 1 |rl|nl|bl|ql|kl|bl|nl|rl|=
    a  b  c  d  e  f  g  h

 8 |rl|nl|bl|kl|ql|bl|nl|rl|=
 7 |pl|pl|pl|pl|pl|pl|pl|pl|=
 6 |  |  |  |  |  |  |  |  |=
 5 |  |  |  |  |  |  |  |  |=
 4 |  |  |  |  |  |  |  |  |=
 3 |  |  |  |  |  |  |  |  |=
 2 |pd|pd|pd|pd|pd|pd|pd|pd|=
 1 |rd|nd|bd|kd|qd|bd|nd|rd|=
    a  b  c  d  e  f  g  h

| '''Bughouse setup and start position'''
}}

Nodyn:Bughouse chess diagram

Alice chess (two players)
{{alice chess diagram
| tright
|
|=
 8 |rd|nd|bd|qd|kd|  |nd|rd|=
 7 |pd|pd|pd|pd|  |pd|pd|pd|=
 6 |  |  |  |  |  |  |  |  |=
 5 |  |  |  |  |nl|  |  |  |=
 4 |  |  |  |  |  |  |  |  |=
 3 |  |  |  |  |  |  |  |  |=
 2 |pl|pl|pl|pl|pl|pl|pl|pl|=
 1 |rl|nl|bl|ql|kl|bl|  |rl|=
    a  b  c  d  e  f  g  h
          Board A

 8 |  |  |  |  |  |  |  |  |=
 7 |  |  |  |  |  |  |  |  |=
 6 |  |  |  |  |pd|  |  |  |=
 5 |  |  |bd|  |  |  |  |  |=
 4 |  |  |  |  |  |  |  |  |=
 3 |  |  |  |  |  |  |  |  |=
 2 |  |  |  |  |  |  |  |  |=
 1 |  |  |  |  |  |  |  |  |=
    a  b  c  d  e  f  g  h
          Board B
| position after '''1. Nf3 e6 2. Ne5 Bc5'''
}}

Nodyn:Alice chess diagram

Different shaped board[golygu cod y dudalen]

Three-dimensional chess (Raumschach) – Template:Raumschach diagram
{{Raumschach diagram
| tright
|
|=
5 |rd|nd|kd|nd|rd|=
4 |pd|pd|pd|pd|pd|=
3 |  |  |  |  |  |=
2 |  |  |  |  |  |=
1 |  |  |  |  |  |=
   Ea Eb Ec Ed Ee

5 |sd|bd|qd|sd|bd|=
4 |pd|pd|pd|pd|pd|=
3 |  |  |  |  |  |=
2 |  |  |  |  |  |=
1 |  |  |  |  |  |=
   Da Db Dc Dd De

5 |  |  |  |  |  |=
4 |  |  |  |  |  |=
3 |  |  |  |  |  |=
2 |  |  |  |  |  |=
1 |  |  |  |  |  |=
   Ca Cb Cc Cd Ce

5 |  |  |  |  |  |=
4 |  |  |  |  |  |=
3 |  |  |  |  |  |=
2 |pl|pl|pl|pl|pl|=
1 |bl|sl|ql|bl|sl|=
   Ba Bb Bc Bd Be

5 |  |  |  |  |  |=
4 |  |  |  |  |  |=
3 |  |  |  |  |  |=
2 |pl|pl|pl|pl|pl|=
1 |rl|nl|kl|nl|rl|=
   Aa Ab Ac Ad Ae

| Raumschach starting position
}}

Nodyn:Raumschach diagram

Omega ChessTemplate:Omega Chess diagram
{{Omega Chess diagram
|
| [[Omega Chess]] (10x10 + 4 corners)
|=
  w4                                   w3
   |wd|=                            |wd|=
    9 |zd|rd|nd|bd|qd|kd|bd|nd|rd|zd|=
    8 |pd|pd|pd|pd|pd|pd|pd|pd|pd|pd|=
    7 |  |  |  |  |  |  |  |  |  |  |=
    6 |  |  |  |  |  |  |  |  |  |  |=
    5 |  |  |  |  |  |  |  |  |  |  |=
    4 |  |  |  |  |  |  |  |  |  |  |=
    3 |  |  |  |  |  |  |  |  |  |  |=
    2 |  |  |  |  |  |  |  |  |  |  |=
    1 |pl|pl|pl|pl|pl|pl|pl|pl|pl|pl|=
    0 |zl|rl|nl|bl|ql|kl|bl|nl|rl|zl|=
   |wl|=                            |wl|=
  w1    a  b  c  d  e  f  g  h  i  j   w2

| '''Omega Chess''' - start position
}}
Nodyn:Omega Chess diagram

See also[golygu cod y dudalen]