Author: Shep
Date: 01:19:02 11/08/99
Go up one level in this thread
On November 05, 1999 at 21:16:40, Peter Kappler wrote:
>>
>>Adding an FEN to diagram converter wouldn't be too hard either, it's just a
>>question of finding the time to do it.
>>
>
>This would be incredibly cool. I would be willing to contribute my time to
>help. I'm sure there would be lots of other volunteers.
Doing it in Perl would be quite easy.
Supposing you have GIFs for the individual pieces ("wnb.gif" for White kNight on
Black square), you could do this:
: Get next character from FEN string
$counter++;
if ($char = "P") $piece="wp";
if ($char = "p") $piece="bp";
: and so on
if ($char = "1") $piece="empty";
: extra treatment for $char=2...8 (a little tricky, but not too hard)
if ($char = "/")
: end current table row, start new one
if ($counter EQ Int($counter)) $square="w"
else $square="b";
$pieceGIF=$piece.$square.".gif";
: display GIF
: repeat
---
Shep
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.