board2diag is a JavaScript tool to easily add board diagrams to a webpage. The
source code was originally made by Hans Bodlaender [hans@chessvariants.com]
and expanded later by Joćo Pedro Neto [jpn@di.fc.ul.pt].
First, one has to include the call to the board2diag.js file, in the following
form:
<SCRIPT LANGUAGE="JavaScript" src="board2diag.js"></SCRIPT>
Then, one can use a new JavaScript part, and make a call to board2diag. This
version assumes all files are in the same directory (this is easily changed).
Just click on
to download the actual version.
The function has one argument, which is a string of the following form:
- Options about the borders: l if the left side is a border, r if the right
side is a border, u if the upper side is a border, d if the down side is a
border
- Comma
- Number of rows
- Comma
- Number of columns
- String that describes the position. Here:
- b is a black soldier, a red soldier, g a green
soldier, l a blue soldier, y a yellow soldier, m a magenta soldier
- if you use uppercase, the stones will be Kings
- a number is a number of successive empty squares
- a / marks the end of a row
- a . is one empty square
- a , is one handicap point
- a ; is one empty cell marked with a green dot
- a : is one empty cell marked with a red dot
- a * is one empty cell with diagonal lines
- a h is a special piece used to define walls, blocks, ... if you use H
it will blink!
- z means cell removal, but then you must use only the '.' notation,
do not use numbers to represent empty cells!
- to place Go stones, use 'xwopqstuv' for black, white, brown,
yellow, gray, blue, green, red, magenta. Use uppercase to mark the
stones.
- to mark empty cell with numbers, use 'a' for 1, 'c' for 2, 'defijkn'
for '3456789'. Use uppercase for letters.
Command @ is used to present specific game pieces and syntax (note: the
use of symbol 'z' is not compatible with these pictures)
- CONNECT GAMES Syntax - @c[x|u][nw connect?][sw connect?][se connect?][ne connect?]
- ROTATE GAMES Syntax - @r[u|t][n|s|e|w|v|h|1|2|3|4|5|6]
- CHESS GAMES Syntax - @x[x|t|u|v|o|p|s][n|b|t|q]
Version 1.2. Apr 2003