If you have a problem or a question please read the readme and check these Frequently Asked Questions.
The BeholderBoard was released in 1999, and is no longer supported.
If you don't know then you are almost certainly not the administrator of a server, so the script is not for you. You can't just drop the script onto your home page — this is a Perl script that needs permissions to write and modify (data) files on the server.
[5-Aug-2000]
The current release of BeholderBoard is version 1.52 which is identical to v1.5, except that it includes a fix to a small bug. If you're already running version 1.5, you should download the current version off this site and replace the script with the latest one.
If you're interested in the grisly minutae, the bug allowed a king to escape check by moving to a square adjacent to the opponent's king, if that square was itself protected (i.e. the opposing king couldn't actually occupy that square).
Alan J. Pippin not only detected the bug but also kindly sent the missing Perl. This went into release v1.51, but there was a weeny problem (it only tested the diagonals) so v1.52 came out soon after, which we believe sorts everything out.
Version 1.5 introduced the long-awaited resign move as well as the flip-board display option. The graphics were optimised so they download a little faster, too.
If you are upgrading from an earlier version, you could just replace the script, although you may as well take the whole lot since you'll benefit from the smaller graphic files. Existing games will continue seamlessly under the latest version. The readme has been updated too, of course, and you should read it.
BeholderBoard v1.5 also fixed a couple of shameful but minor bugs from earlier versions.
"No boards are currently set up" is what the BeholderBoard says when it can't find the board???.txt data file(s). It's not a problem with the permissions or format of the files, because that is reported differently.
Experience has shown it's probably one of three things — either you have messed up the $DATAFNAME variable (see fix 1), the filenames are not all lower case (fix 2), or your Perl/cgi daemon does not use the script's directory as its default directory (see fix 3). If things still look bleak, revert to the default settings (fix 4).
By default the script looks for files called board???.txt because that's the setting of the $DATAFNAME variable ("board.txt"). Note that board.txt is not a file — it's just a filename template, and the script inserts the three digits before the dot (.). Therefore if you have changed the setting to a filename such as...
$DATAFNAME = 'board001.txt'; # wrong!
...it will look for board001???.txt, which probably isn't what you meant. Revert to something like...
$DATAFNAME = 'board.txt'; # better
By the way, $DATAFNAME won't work as a template if it doesn't have one "." in it.
Check that the file really is called board001.txt and not Board001.txt — it must be lower case. Read the following anyway, to be sure.
The search is case sensitive. This is what you'd expect in Unixland, but if you're running on a Windows platform beware of Mr Gate's nasty habit of silently capitalising the initial letter of the file name. Board123.txt, for example, won't work. The simple solution to this is to force lower case filenames when you create the data files.
If you are familiar with Perl, and you don't like the simple solution, you can instead make the file search case insensitive by adding the i option at the end of the regular expression that grep uses on the file list. This is line 770 of the script, which would then read:
....sort grep/^$prefix\d\d\d$suffix$/i,...
Don't do this if you're running on a Unix system, because if you do you can end up with board001.txt and Board001.txt coexisting, which you don't want.
Alternatively, set the value of $DATAFNAME to have a capitalised initial if your data files always have one.
The script looks in the $DATAPATH directory for any files called board???.txt, where ??? are three digits (i.e. 000 through to 999). By default the $DATAPATH directory is blank, which generally means it will look for the board???.txt files in the same directory that the script is in.
However, this might not work if your server is not configured to consider the script's location as the default directory, especially if you have put the script or the files in a subdirectory of the cgi-bin (which you may do, of course). In this case, the comment in the script which says that $DATAPATH is relative to this script should be ignored — instead it's relative to the current working directory.
"Normal" behaviour for server cgi seems to be to inherit the path of the script (in this case, the board.pl script) as its current working directory, which is what the BeholderBoard anticipates. However, if your server doesn't do this, then it's almost certainly using cgi-bin itself as the current working directory instead. The default set-up ought to work in both cases, because everything is piled into the cgi-bin directory anyway, but if you have been orderly enough to use (for example) a subdirectory called cgi-bin/mychess, then the path setting will either be $DATAPATH="" (try this first) or else $DATAPATH="mychess". You probably never want to have any /'s in there, by the way.
Bear in mind, too, that your cgi-bin might not be called cgi-bin.
If things go really astray, you should try sticking to the default settings to make your life a little bit easier, at least to start with. The default set-up is a file system like this:
Yes. The easiest way is to make the initial link to it with ?dj=1 after the URL. For example, if you've kept the default settings (and your cgi-bin is indeed called cgi-bin), link to the script like this:
<a href="/cgi-bin/board.pl?dj=1">...
You'll need to change this in index.html (and anywhere else where there's a static link to the script from your pages). The dj=1 setting gets propagated into all subsequent pages that the script outputs.
Version 2 of BeholderBoard included a checkmate detector but never got released because it was included in a commercial product instead.
The dream once lingered of a BeholderBoard that would actually notice checkmate. Or allow draws. Or output PGN format games. Or had ears on the knight. And so on. But it's not going to happen because I have moved on to other projects.
The original board didn't do this sort of thing because it was only ever meant to be a virtual chess set. Indeed, at first the rejection of illegal moves was only added out of compassion. Don't forget that real Staunton chess sets don't know about checkmate and resigning either.
You are mildly discouraged from changing the colours of the squares, because the graphics' anitaliasing is based on them, but if you really must you'll find it hidden deep in line 991 of the script. The white squares are, uh, white and the black squares are "#555555" (Perl says '5' x 6 ). If you just want a paler shade of grey, change that 5 to a higher number (it's a single hex digit since these are HTML-style colour definitions).
Of course some people want to change not just the shade but the actual colour of the squares... in which case you can try changing the colour expression from
($sq eq'b'?'5':'f')x 6
...to...
($sq eq'b'? $DARKSQUARE:$LIGHTSQUARE )
where you've earlier set $DARKSQUARE='604020' and $LIGHTSQUARE='ffdfbf' or suchlike. Be careful not to choose colours which result in light squares being darker than dark squares... If you're really keen and you don't mind boring your visitors with lengthy download times, it's feasible to use background graphics for individual table cells — and you could have a marble chessboard. If that's the kind of thing you like.
You certainly can, and feel free to make the board look like it belongs with your other pages. You'll have to dive into the Perl but actually the basic colour scheme is set up in variables just below the local configuration section at the top of the script. Of course you can add your own images or whatever too. But please retain the link back to Beholder so that anyone who likes your board realises that they too could have such a thing, for free. After all, it worked for you.
Be careful that the text colour you choose can be seen above the background and border colours.
If you do modify the actual performance of the script at all (rather than cosmetic changes to its presentation), please take the beholder email address off it simply because you'd prefer users to mail you with any problems arising from it rather than me, right? A credit like...
based on the BeholderBoard Virtual Chess-set
...is lovely, thank you.
Make sure the containing frame has a name (e.g. "myframe"). There may well be more than one way of doing this, but a proven method for Javascript-enabled use is to replace line 910:
window.name="chessboard";
with
frame="myframe";
Then edit the Perl script at line 915, and change the href's target:
target="chessboard"
to
target="myframe"
(Provided by Barry Swan.)
If you are running an older version then yes, you should upgrade and yes, your existing games will continue seamlessly under v1.5. Not only does v1.5 have the resign and flip-board features, it also fixes two shameful bugs that sneaked into previous versions.
You're running on an old version of the BeholderBoard. Tell the webmaster who is hosting it to upgrade to v1.5.
Pawn promotion bug:
This problem only affected v1.41 when Javascript was disabled. A workaround is to enable Javascript for this move, if your browser supports it.
Otherwise, the webmaster hosting the board will need to edit the data files directly to make that move for you. It's much easier to upgrade to v1.5.
Incredibly, yes there is, but it's not the standard release. You can grab the special version (which has a text-only option) of the script here: boardtxt.pl [about 37Kb]. Unfortunately, the text-only version has not been updated to v1.5 level, so there's no flip-board or resign in it yet. Sorry.
The current version of BeholderBoard does not include a text-only facility because it was actually created as a 3d modelling exercise... and demand for a text-only option is low... and you don't want your everyday visitors stumbling upon anything as ghastly as text-only output when they should be feasting their eyes on the elegant yet sophisticated graphics that the BeholderBoard is all about... But if you have a special requirement (you use Lynx, or you want to do some nerdy text-parsing of the BeholderBoard's output), then use boardtxt.pl. Alternatively, modify the script yourself to suit your needs.
There are three ways of using the text-only version. If you never, ever want the graphical interface, then boardtxt.pl (and the standard readme of course... and this FAQ...) really is all you need. Just ignore the bit about installing the graphics files.
Alternatively, you can install the full BeholderBoard and then replace board.pl with boardtxt.pl. This works because boardtxt.pl fully implements the usual graphical interface but has the additional "text-only" option on top.
It's also possible to have both scripts side-by-side in your cgi-bin, since they can happily share the same data files.
You can force text-only to be the default by passing tx=1 into the script. Change any external links like this:
<a href="/cgi-bin/boardtxt.pl?tx=1">...
Thanks to Aron Green for suggestions on curing the original BeholderBoard's Lynxlessness. For now, this is the middle way — it's not lovely, but it works. One day, the text-only option might be integrated slightly more beautifully into a future release of the BeholderBoard. But then again, it might not.
Why don't you go and play on Yahoo!'s chess server?
See www.yahoo.com (you need to register, but it's free).
Get a more recent release of Perl :-)
Yes I could but I'm too busy on other things. That's why you're reading the FAQ instead of asking by email, see? Certainly, letting players set up their own games needn't be the terrible security risk the readme would have you believe. Furthermore, if you have boards expire after n days of inactivity, it becomes pretty much self-maintaining.
For an example of such a system, see Ross Barker's excellent implementation of the BeholderBoard on www.reboot.com.au. His script allows players to set up their own games, and if you ask him nicely he is on record as having said that if anyone else would like some help, he's willing to pass on what he has learned. That might even run to giving you the script.
If you'd rather roll up your own sleeves and write a script for on-line board setup yourself, this Perl snippet might help. It gives the lowest free board filename (code by Ian Rogers). Have a look around line 713 of the script, where $prefix, $suffix and then @boards are set up. After that you can use this somewhere:
$_=0; while(++$_<1000){last if $boards[$_-1]!~/^$prefix0?0?$_$suffix$/} $free=$_<1000?$_:0; if (! $free) { $err = "No free boards! "; } my $NEWBOARDFILE = sprintf ">$here/$prefix%03d$suffix" , $free;
Back to the BeholderBoard