Reply
 
LinkBack Thread Tools Display Modes
  #1   Report Post  
Old October 9th 08, 04:58 AM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: Oct 2008
Posts: 3
Default How to program an FICS chess client

Hello,

I want to program an internet chess client. My objective is to keep
the code size as small as possible(small memory foot-print also).

Basically what I need is:

-Legal move detection(see which moves are allowed).
-Checkmate/Stalemate detection
-threefold repetition detection
-send commands to server and parse answers from server.

So where can I read the basic algorithms used to do this so I don't
need to reinvent the wheel?

I was reading about bitboards, but I guess this would be overkill
because I'm not making a chess engine, only a client.

How about interacting with the server? Is there any documentation on
how to handle this, how to parse server messages?

Thanks for any feedback!

Roland

PS: Please don't answer to the email. I rarely read it and it's full
of spam.
  #2   Report Post  
Old October 9th 08, 02:49 PM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: Apr 2005
Posts: 2,598
Default How to program an FICS chess client

Roland wrote:
Basically what I need is:

-Legal move detection(see which moves are allowed).
-Checkmate/Stalemate detection
-threefold repetition detection
-send commands to server and parse answers from server.


I believe that threefold repetition detection would be illegal on
FICS, as it counts as assistance to the player. (Remember that
threefold repetition does not end the game -- it merely gives a player
the right to claim a draw.)

You don't need to detect checkmate or stalemate because the server
will tell you that the game is over and why. Also, I don't think you
actually need to do legal move detection, since the server won't let
you make an illegal move. If I recall correctly, the protocol sends
moves by quoting the source and destination square, so (I think) you
wouldn't even need to parse strings like `Nab3', just `a5b3'. But
you'll need to detect castling (the king just moved two squares so
shift the rook, too) and en passant (a pawn just captured to an empty
square so delete the pawn on the square behind it).

So I think you should be able to do this with almost no `chess
programming'. That said, it would probably be better to do legal move
checking yourself as letting the server do it adds lag if the player
does make an illegal move. (And I used to make illegal moves quite
often. If I picked up a piece with the mouse and decided not to move
it after all, I'd drop it on top of one of my own pieces. This is
guaranteed to be an illegal move so the piece returns to its original
square. Manually returning it to its square is risky because you
might put it on the wrong square and make a move by mistake.)


Dave.

--
David Richerby Hungry Cat (TM): it's like a cuddly
www.chiark.greenend.org.uk/~davidr/ pet but it'll eat you!
  #3   Report Post  
Old October 9th 08, 05:27 PM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: Oct 2008
Posts: 3
Default How to program an FICS chess client

So I think you should be able to do this with almost no `chess
programming'. That said, it would probably be better to do legal move
checking yourself as letting the server do it adds lag if the player


Exactly! So what is the best way to do legal move detection?
  #4   Report Post  
Old October 9th 08, 07:56 PM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: Jul 2006
Posts: 625
Default How to program an FICS chess client

* Roland (18:27) schrieb:

So I think you should be able to do this with almost no `chess
programming'. That said, it would probably be better to do legal move
checking yourself as letting the server do it adds lag if the player


Exactly! So what is the best way to do legal move detection?


Well, the simplest thing to test a Is there a piece of your own color
on the destination square and is there a piece of your own color on the
source square?

Everything else is way more complicated and nothing you should start
with. Get the client working and if tf there is a lag, work on that.

mfg, simon .... l
  #5   Report Post  
Old October 17th 08, 07:03 PM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: Oct 2008
Posts: 3
Default How to program an FICS chess client


Well, the simplest thing to test a Is there a piece of your own color
on the destination square and is there a piece of your own color on the
source square?

Everything else is way more complicated and nothing you should start
with. Get the client working and if tf there is a lag, work on that.


No it's not that complicated, I've been a programmer for many years.
And I want to start collecting info now so that when I get to code the
relevant parts I already have it. I mean, legal move detection is a
basic for any chess program and I was assuming there are already well
known and discussed algorithms for doing that. Am I wrong? Can anyone
provide me with pointers or do I have to reinvent the wheel? Does
every chess program author implement his own legal move detection?


  #6   Report Post  
Old October 18th 08, 01:01 AM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: Jul 2006
Posts: 625
Default How to program an FICS chess client

* Roland (20:03) schrieb:

Well, the simplest thing to test a Is there a piece of your own color
on the destination square and is there a piece of your own color on the
source square?

Everything else is way more complicated and nothing you should start
with. Get the client working and if tf there is a lag, work on that.


No it's not that complicated, I've been a programmer for many years.


Then you probably heard about "do the simplest thing that can possibly
work".

And I want to start collecting info now so that when I get to code the
relevant parts I already have it. I mean, legal move detection is a
basic for any chess program and I was assuming there are already well
known and discussed algorithms for doing that. Am I wrong? Can anyone
provide me with pointers or do I have to reinvent the wheel? Does
every chess program author implement his own legal move detection?


That's normally not needed. All you need to have is pseudo legal move
generation (moving in the right direction and not jumping over pieces)
and a detection for illegal positions where the king is in check[1].

That's all you need for inside the search. If you need to test or parse
a move for legality you can generate a list of pseudo legal moves and
filter the illegal ones out by doing them and checking the result. Then
you can lookup the move to be tested/parsed in the list.

You can look for algorithms in the chess programming wiki. There are
also special tests that test moves inside the search, needed for killer
moves.

But chess engines and front ends have very different performance
requirements.

mfg, simon .... l

[1] Okay, castlings are a little more complicated.
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
rec.games.chess.misc FAQ [2/4] [email protected] rec.games.chess.misc (Chess General) 0 May 8th 06 05:24 AM
rec.games.chess.misc FAQ [2/4] [email protected] rec.games.chess.misc (Chess General) 0 April 23rd 06 05:21 AM
rec.games.chess.misc FAQ [2/4] [email protected] rec.games.chess.misc (Chess General) 0 January 3rd 06 06:04 AM
Wikipedia Biography of Eric Schiller Sam Sloan rec.games.chess.misc (Chess General) 2 December 22nd 05 08:02 PM
rec.games.chess.misc FAQ [2/4] [email protected] rec.games.chess.misc (Chess General) 0 November 18th 05 05:36 AM


All times are GMT +1. The time now is 03:37 AM.

Powered by vBulletin® Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright 2004-2019 ChessBanter.
The comments are property of their posters.
 

About Us

"It's about Chess"

 

Copyright © 2017