Template:4pc diagram/doc

Usage

edit

The syntax for the four-player chess diagram is as follows:

{{4pc diagram
| <header> (param #1)
| <alignment> (#2)
| size = 
| numbers = 
| letters = 
|  |  |  |<d14>|<e14>|...|<k14>|  |  |  | (#3 to ...)
|  |  |  |<d13>|<e13>|...|<k13>|  |  |  |
|  |  |  |<d12>|<e12>|...|<k12>|  |  |  |
|<a11>|<b11>|...|<n11>|
...
|<a4>|<b4>|...|<n4>|
|  |  |  |<d3>|<e3>|...|<k2>|  |  |  |
|  |  |  |<d2>|<e2>|...|<k2>|  |  |  |
|  |  |  |<d1>|<e1>|...|<k1>|  |  |  | (... #198)
| <footer> (#199)
}}

Parameters:

  • <header> — The text which appears above the diagram. (Optional.)
  • <alignment> — Defines horizontal alignment (floating) of the whole table. Options are: tright or tleft (or nothing).
  • size — Defines the size of the squares in pixels. (Default: 25px. Use 20px minimum.)
  • numbers — Specifies whether the rank numbers are displayed or not. Options are: left, right, both (default) or neither.
  • letters — Specifies whether the file letters are displayed or not. Options are: top, bottom, both (default) or neither.
  • <d1>, <e1>, ... <k14> — Define corresponding squares of the chessboard. (See below.)
  • <footer> — The text which appears beneath the diagram. (Optional.)

The occupancy of a square is defined by the piece identifier or an empty parameter (two spaces are recommended). The piece identifiers consist of a lowercase letter for the colour (r = red, b = blue, y = yellow and g = green) and an uppercase letter for the piece (P = pawn, N = knight, B = bishop, R = rook, Q = queen and K = king).

= rK = bK = yK = gK
= rQ = bQ = yQ = gQ
= rR = bR = yR = gR
= rB = bB = yB = gB
= rN = bN = yN = gN
= rP = bP = yP = gP

Arrows can be used to show movement directions and a cross and circle are available to mark squares.

= ul (up left) = ua (up arrow) = ur (up right)
= la (left arrow) = xx = xo = ra (right arrow)
= dl (down left) = da (down arrow) = dr (down right)
= lr (left right) = ud (up down) = di (diagonal) = ad (anti-diagonal)

Examples

edit

For the sake of clarity, it is possible to add the file letters and rank numbers in the source, as in the following example. Any text between "|=" and the next "|" is ignored.

Four-player chess board
a b c d e f g h i j k l m n
14{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} yellow rook{{{square}}} yellow knight{{{square}}} yellow bishop{{{square}}} yellow king{{{square}}} yellow queen{{{square}}} yellow bishop{{{square}}} yellow knight{{{square}}} yellow rook{{{square}}} red king{{{square}}} red king{{{square}}} red king14
13{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} yellow pawn{{{square}}} yellow pawn{{{square}}} yellow pawn{{{square}}} yellow pawn{{{square}}} yellow pawn{{{square}}} yellow pawn{{{square}}} yellow pawn{{{square}}} yellow pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king13
12{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king12
11{{{square}}} blue rook{{{square}}} blue pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} green pawn{{{square}}} green rook11
10{{{square}}} blue knight{{{square}}} blue pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} green pawn{{{square}}} green knight10
9{{{square}}} blue bishop{{{square}}} blue pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} green pawn{{{square}}} green bishop9
8{{{square}}} blue king{{{square}}} blue pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} green pawn{{{square}}} green queen8
7{{{square}}} blue queen{{{square}}} blue pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} green pawn{{{square}}} green king7
6{{{square}}} blue bishop{{{square}}} blue pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} green pawn{{{square}}} green bishop6
5{{{square}}} blue knight{{{square}}} blue pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} green pawn{{{square}}} green knight5
4{{{square}}} blue rook{{{square}}} blue pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} green pawn{{{square}}} green rook4
3{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king3
2{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red pawn{{{square}}} red pawn{{{square}}} red pawn{{{square}}} red pawn{{{square}}} red pawn{{{square}}} red pawn{{{square}}} red pawn{{{square}}} red pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king2
1{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red rook{{{square}}} red knight{{{square}}} red bishop{{{square}}} red queen{{{square}}} red king{{{square}}} red bishop{{{square}}} red knight{{{square}}} red rook{{{square}}} red king{{{square}}} red king{{{square}}} red king1
a b c d e f g h i j k l m n
Starting position.


{{4pc diagram
| '''Four-player chess board'''
| tright
|=

 14 |  |  |  |yR|yN|yB|yK|yQ|yB|yN|yR|  |  |  |=
 13 |  |  |  |yP|yP|yP|yP|yP|yP|yP|yP|  |  |  |=
 12 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |=
 11 |bR|bP|  |  |  |  |  |  |  |  |  |  |gP|gR|=
 10 |bN|bP|  |  |  |  |  |  |  |  |  |  |gP|gN|=
  9 |bB|bP|  |  |  |  |  |  |  |  |  |  |gP|gB|=
  8 |bK|bP|  |  |  |  |  |  |  |  |  |  |gP|gQ|=
  7 |bQ|bP|  |  |  |  |  |  |  |  |  |  |gP|gK|=
  6 |bB|bP|  |  |  |  |  |  |  |  |  |  |gP|gB|=
  5 |bN|bP|  |  |  |  |  |  |  |  |  |  |gP|gN|=
  4 |bR|bP|  |  |  |  |  |  |  |  |  |  |gP|gR|=
  3 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |=
  2 |  |  |  |rP|rP|rP|rP|rP|rP|rP|rP|  |  |  |=
  1 |  |  |  |rR|rN|rB|rQ|rK|rB|rN|rR|  |  |  |=
     a  b  c  d  e  f  g  h  i  j  k  l  m  n

| Starting position.
}}


Another example with a reduced square size and without file and rank labels.

Small four-player chess board
{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} yellow rook{{{square}}} yellow knight{{{square}}} yellow bishop{{{square}}} yellow king{{{square}}} yellow queen{{{square}}} yellow bishop{{{square}}} yellow knight{{{square}}} yellow rook{{{square}}} red king{{{square}}} red king{{{square}}} red king
{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} yellow pawn{{{square}}} yellow pawn{{{square}}} yellow pawn{{{square}}} yellow pawn{{{square}}} yellow pawn{{{square}}} yellow pawn{{{square}}} yellow pawn{{{square}}} yellow pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king
{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king
{{{square}}} blue rook{{{square}}} blue pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} green pawn{{{square}}} green rook
{{{square}}} blue knight{{{square}}} blue pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} green pawn{{{square}}} green knight
{{{square}}} blue bishop{{{square}}} blue pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} green pawn{{{square}}} green bishop
{{{square}}} blue king{{{square}}} blue pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} green pawn{{{square}}} green queen
{{{square}}} blue queen{{{square}}} blue pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} green pawn{{{square}}} green king
{{{square}}} blue bishop{{{square}}} blue pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} green pawn{{{square}}} green bishop
{{{square}}} blue knight{{{square}}} blue pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} green pawn{{{square}}} green knight
{{{square}}} blue rook{{{square}}} blue pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} green pawn{{{square}}} green rook
{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king
{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red pawn{{{square}}} red pawn{{{square}}} red pawn{{{square}}} red pawn{{{square}}} red pawn{{{square}}} red pawn{{{square}}} red pawn{{{square}}} red pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king
{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red rook{{{square}}} red knight{{{square}}} red bishop{{{square}}} red queen{{{square}}} red king{{{square}}} red bishop{{{square}}} red knight{{{square}}} red rook{{{square}}} red king{{{square}}} red king{{{square}}} red king
Smaller diagram without file and rank labels.


{{4pc diagram
| '''Small four-player chess board'''
| tright
| size = 20
| numbers = neither
| letters = neither
|=

 14 |  |  |  |yR|yN|yB|yK|yQ|yB|yN|yR|  |  |  |=
 13 |  |  |  |yP|yP|yP|yP|yP|yP|yP|yP|  |  |  |=
 12 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |=
 11 |bR|bP|  |  |  |  |  |  |  |  |  |  |gP|gR|=
 10 |bN|bP|  |  |  |  |  |  |  |  |  |  |gP|gN|=
  9 |bB|bP|  |  |  |  |  |  |  |  |  |  |gP|gB|=
  8 |bK|bP|  |  |  |  |  |  |  |  |  |  |gP|gQ|=
  7 |bQ|bP|  |  |  |  |  |  |  |  |  |  |gP|gK|=
  6 |bB|bP|  |  |  |  |  |  |  |  |  |  |gP|gB|=
  5 |bN|bP|  |  |  |  |  |  |  |  |  |  |gP|gN|=
  4 |bR|bP|  |  |  |  |  |  |  |  |  |  |gP|gR|=
  3 |  |  |  |  |  |  |  |  |  |  |  |  |  |  |=
  2 |  |  |  |rP|rP|rP|rP|rP|rP|rP|rP|  |  |  |=
  1 |  |  |  |rR|rN|rB|rQ|rK|rB|rN|rR|  |  |  |=
     a  b  c  d  e  f  g  h  i  j  k  l  m  n

| Smaller diagram without file and rank labels.
}}


The next example shows a diagram with arrows and marked squares.

Four-player chess board with arrows
{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} yellow rook{{{square}}} yellow knight{{{square}}} yellow bishop{{{square}}} yellow king{{{square}}} yellow queen{{{square}}} yellow bishop{{{square}}} yellow knight{{{square}}} yellow rook{{{square}}} red king{{{square}}} red king{{{square}}} red king
{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} yellow pawn{{{square}}} yellow pawn{{{square}}} yellow pawn{{{square}}} yellow pawn{{{square}}} di{{{square}}} yellow pawn{{{square}}} yellow pawn{{{square}}} yellow pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king
{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} di{{{square}}} yellow pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king
{{{square}}} blue rook{{{square}}} blue pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} di{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} green pawn{{{square}}} green rook
{{{square}}} blue knight{{{square}}} blue pawn{{{square}}} red king{{{square}}} red king{{{square}}} di{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} xx{{{square}}} red king{{{square}}} green pawn{{{square}}} green knight
{{{square}}} blue bishop{{{square}}} blue pawn{{{square}}} red king{{{square}}} di{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} green pawn{{{square}}} red king{{{square}}} green bishop
{{{square}}} blue king{{{square}}} blue pawn{{{square}}} di{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} xx{{{square}}} red king{{{square}}} green pawn{{{square}}} green queen
{{{square}}} blue queen{{{square}}} di{{{square}}} blue pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} green pawn{{{square}}} green king
{{{square}}} blue bishop{{{square}}} blue pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} green pawn{{{square}}} green bishop
{{{square}}} blue knight{{{square}}} blue pawn{{{square}}} la{{{square}}} la{{{square}}} la{{{square}}} la{{{square}}} la{{{square}}} la{{{square}}} la{{{square}}} la{{{square}}} xo{{{square}}} red king{{{square}}} green pawn{{{square}}} green knight
{{{square}}} blue rook{{{square}}} blue pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} ur{{{square}}} red king{{{square}}} red king{{{square}}} green pawn{{{square}}} green rook
{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red pawn{{{square}}} ur{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red king
{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red pawn{{{square}}} red pawn{{{square}}} red pawn{{{square}}} red pawn{{{square}}} ur{{{square}}} red pawn{{{square}}} red pawn{{{square}}} red pawn{{{square}}} red king{{{square}}} red king{{{square}}} red king
{{{square}}} red king{{{square}}} red king{{{square}}} red king{{{square}}} red rook{{{square}}} red knight{{{square}}} red bishop{{{square}}} red queen{{{square}}} red king{{{square}}} red bishop{{{square}}} red knight{{{square}}} red rook{{{square}}} red king{{{square}}} red king{{{square}}} red king
Diagram with arrows and marked squares.


{{4pc diagram
| '''Four-player chess board with arrows'''
| tright
| size = 20
| numbers = neither
| letters = neither
|=

 14 |  |  |  |yR|yN|yB|yK|yQ|yB|yN|yR|  |  |  |=
 13 |  |  |  |yP|yP|yP|yP|di|yP|yP|yP|  |  |  |=
 12 |  |  |  |  |  |  |di|yP|  |  |  |  |  |  |=
 11 |bR|bP|  |  |  |di|  |  |  |  |  |  |gP|gR|=
 10 |bN|bP|  |  |di|  |  |  |  |  |xx|  |gP|gN|=
  9 |bB|bP|  |di|  |  |  |  |  |  |  |gP|  |gB|=
  8 |bK|bP|di|  |  |  |  |  |  |  |xx|  |gP|gQ|=
  7 |bQ|di|bP|  |  |  |  |  |  |  |  |  |gP|gK|=
  6 |bB|bP|  |  |  |  |  |  |  |  |  |  |gP|gB|=
  5 |bN|bP|la|la|la|la|la|la|la|la|xo|  |gP|gN|=
  4 |bR|bP|  |  |  |  |  |  |  |ur|  |  |gP|gR|=
  3 |  |  |  |  |  |  |  |rP|ur|  |  |  |  |  |=
  2 |  |  |  |rP|rP|rP|rP|ur|rP|rP|rP|  |  |  |=
  1 |  |  |  |rR|rN|rB|rQ|rK|rB|rN|rR|  |  |  |=
     a  b  c  d  e  f  g  h  i  j  k  l  m  n

| Diagram with arrows and marked squares.
}}