Module:Chessboard-3x3/doc

From ProofWiki
Jump to navigation Jump to search

This is the documentation page for Module:Chessboard-3x3

Chessboard Module

This module is to support a basic implementation of a chessboard, but for a 3x3 version.


The user is invited to learn by example from the below.

The following:

{{ChessDiagram|
|'''A famous chess match'''
|rd|  |bd|qd|kd|bd|  |rd
|pd|pd|pd|pd|  |ql|pd|pd
|  |  |nd|  |  |nd|  |  
|  |  |  |  |pd|  |  |  
|  |  |bl|  |pl|  |  |  
|  |  |  |  |  |  |  |  
|pl|pl|pl|pl|  |pl|pl|pl
|rl|nl|bl|  |kl|  |nl|rl
|Scholar's Mate – Black is checkmated. 
}}


...produces the following:


A famous chess match
abcdefgh
8
Chessboard-480.png
a8 black rook
c8 black bishop
d8 black queen
e8 black king
f8 black bishop
h8 black rook
a7 black pawn
b7 black pawn
c7 black pawn
d7 black pawn
f7 white queen
g7 black pawn
h7 black pawn
c6 black knight
f6 black knight
e5 black pawn
c4 white bishop
e4 white pawn
a2 white pawn
b2 white pawn
c2 white pawn
d2 white pawn
f2 white pawn
g2 white pawn
h2 white pawn
a1 white rook
b1 white knight
c1 white bishop
e1 white king
g1 white knight
h1 white rook
8
77
66
55
44
33
22
11
abcdefgh
Scholar's Mate – Black is checkmated.


Notice that the first argument is blank.


They may be presented as left or right thumbnails by invoking tleft or tright for the first argument, as follows:

A famous chess match
abcdefgh
8
Chessboard-480.png
a8 black rook
c8 black bishop
d8 black queen
e8 black king
f8 black bishop
h8 black rook
a7 black pawn
b7 black pawn
c7 black pawn
d7 black pawn
f7 white queen
g7 black pawn
h7 black pawn
c6 black knight
f6 black knight
e5 black pawn
c4 white bishop
e4 white pawn
a2 white pawn
b2 white pawn
c2 white pawn
d2 white pawn
f2 white pawn
g2 white pawn
h2 white pawn
a1 white rook
b1 white knight
c1 white bishop
e1 white king
g1 white knight
h1 white rook
8
77
66
55
44
33
22
11
abcdefgh
Scholar's Mate – Black is checkmated.
A famous chess match
abcdefgh
8
Chessboard-480.png
a8 black rook
c8 black bishop
d8 black queen
e8 black king
f8 black bishop
h8 black rook
a7 black pawn
b7 black pawn
c7 black pawn
d7 black pawn
f7 white queen
g7 black pawn
h7 black pawn
c6 black knight
f6 black knight
e5 black pawn
c4 white bishop
e4 white pawn
a2 white pawn
b2 white pawn
c2 white pawn
d2 white pawn
f2 white pawn
g2 white pawn
h2 white pawn
a1 white rook
b1 white knight
c1 white bishop
e1 white king
g1 white knight
h1 white rook
8
77
66
55
44
33
22
11
abcdefgh
Scholar's Mate – Black is checkmated.
{{ChessDiagram|tleft
|'''A famous chess match'''
|rd|  |bd|qd|kd|bd|  |rd
|pd|pd|pd|pd|  |ql|pd|pd
|  |  |nd|  |  |nd|  |  
|  |  |  |  |pd|  |  |  
|  |  |bl|  |pl|  |  |  
|  |  |  |  |  |  |  |  
|pl|pl|pl|pl|  |pl|pl|pl
|rl|nl|bl|  |kl|  |nl|rl
|Scholar's Mate – Black is checkmated. 
}}
{{ChessDiagram|tright
|'''A famous chess match'''
|rd|  |bd|qd|kd|bd|  |rd
|pd|pd|pd|pd|  |ql|pd|pd
|  |  |nd|  |  |nd|  |  
|  |  |  |  |pd|  |  |  
|  |  |bl|  |pl|  |  |  
|  |  |  |  |  |  |  |  
|pl|pl|pl|pl|  |pl|pl|pl
|rl|nl|bl|  |kl|  |nl|rl
|Scholar's Mate – Black is checkmated. 
}}


... and so it is seen they behave as thumbnails are expected to.


You can add arrows in various directions and configurations:


{{ChessDiagram|
|'''Examples of arrows'''
|  |ud|  |  |  |  |  |  
|lr|rd|lr|  |  |ox|  |  
|  |ud|  |  |  |  |  |  
|  |  |  |  |  |  |  |  
|  |  |  |ul|ua|ur|  |  
|  |xx|  |la|kl|ra|  |  
|  |  |  |dl|da|dr|  |  
|  |  |  |  |  |  |  |  
|
}}


...produces the following:


Examples of arrows
abcdefgh
8
Chessboard-480.png
b8 up-down arrow
a7 left-right arrow
b7 black rook
c7 left-right arrow
f7 white cross
b6 up-down arrow
d4 up-left arrow
e4 up arrow
f4 up-right arrow
b3 black cross
d3 left arrow
e3 white king
f3 right arrow
d2 down-left arrow
e2 down arrow
f2 down-right arrow
8
77
66
55
44
33
22
11
abcdefgh