tower2diag
tower2diag is a JavaScript tool to easily add boards with stacks or towers
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
form:
<SCRIPT LANGUAGE="JavaScript" src="tower2diag.js"></SCRIPT>
Then, one can use a new JavaScript part, and make a call to tower2diag. 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 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
- Comma
- Number of columns of the maximal row
- Comma
- 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