to a webpage. The
source code was based on the board2diag tool.
First, one has to include the call to the tower2diag.js file, in the following
version assumes all files are in the same directory (this is easily changed).
Just click on
to download the actual version.
The function has two arguments, the
first is a background image for the board (include relative path and extension). The
second argument is a string of the following form:
- Number of columns of the first row
- Number of columns of the maximal row
- String that describes the position. Here:
- a / marks the end of a row
- a . is one empty square
- 1 to 5, places a tower of 1 to 5 black pieces
- 6 to 0, places a tower of 1 to 5 white pieces
- [abcde] places a tower with five pieces, namely, use 'xwycbgrm' for black, white,
yellow, gray, blue, green, red, magenta. Use uppercase to mark them
(this mark can be used to represent more than 6 stones per stack, for
e.g., each mark means 5 stones).
It's also possible to place an empty cell by using letter 'e'.
- to mark empty cell with numbers, use 'abcdefghi' for 1 to 9.
- to remove a cell inside the board, use 'z'
Version 0.31 - June 2002