blended has asked for the wisdom of the Perl Monks concerning the following question:

Before I go on the biggest hack of my life, does anyone know of a previous attempt or related code for a perl chess server interface?

I know of some graphics in Games::Chess but otherwise CPAN drew a blank. If not, I'm thinking a POE implementation would be fun to code up.

Any hints?

blended

Replies are listed 'Best First'.
Re: Perl Chess Server
by danichka (Hermit) on Jan 18, 2002 at 22:48 UTC
    Wombat has given you a head start on this one.

    I have also looked at the Games::Chess modules some time ago and was unimpressed. When I get some more experience I am going to take a shot at improving them.
    I have some code at home I wrote a while back that I will be happy to send you too if you want. It's a fully functional chess engine that I wrote in perl. It knows about castling, en passant, and promotion, but it is not that great since I gave up on it soon after I started. ;-/

    I love CPAN!
      Dear danichka, please could you send me your engine to martin@fabiani.net? If you want to get mine (castling, en passant and promotion not yet finished), I can send you as well.

      Best regards,
      perl -e "print a|r,p|d=>b|p=>chr 3**2 .7=>t and t"

      Sounds like a good start. Could you send me this at zyg@optushome.com.au I'll let you know how it goes... blended
Re: Perl Chess Server
by strat (Canon) on Jan 18, 2002 at 21:54 UTC
    Some years ago, I've written an engine that shows all permitted moves in a certain position. I think, only some castling-rules were not correct, but I could send you the code if you want.

    Best regards,
    perl -e "print a|r,p|d=>b|p=>chr 3**2 .7=>t and t"

Re: Perl Chess Server
by tstock (Curate) on Jan 19, 2002 at 07:51 UTC
    One seldom observed legal move is a pawn taking a pawn "en passant". This happen when a pawn moves 2 spaces and stops besides an opposing pawn, which can then move in a diagonal, behind the first pawn, and takes him out in the process.

    the castling rule that is tricky is that a king can not castle when in check or if it passes over a square that would be in check.

    Tiago
      the castling rule that is tricky is that a king can not castle when in check or if it passes over a square that would be in check.

      Or if the king (or rook) has already moved...(even if they're now at their initial position.
Re: Perl Chess Server
by strat (Canon) on Jan 21, 2002 at 02:46 UTC
    I just had a look at http://sourceforge.net/search/ and searched for chess. Maybe there you could find some interesting stuff :-)

    Best regards,
    perl -e "print a|r,p|d=>b|p=>chr 3**2 .7=>t and t"

      Go to http://www.watson-net.com/free/perl/s_chess.asp I'm quite new at Perl but I'm working nevertheless on a Chess server. So far I have only some C++ code, but I decided to go Perl, because our sysadm doesn't like (for some reason) my server crashing C++ CGI apps.

      I've downloaded the chess.pl file from the site above, but as a newbie to perl I prefere to invent the wheel myself. I have an idea of how to refresh a window or a frame only when needed, like a chess board or a chat window.

      Johan Halmén