Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: I'm having trouble with boards!

Author: Tony Werten

Date: 06:59:11 08/06/01

Go up one level in this thread


On August 06, 2001 at 09:20:16, Adrian Smith wrote:

>On August 06, 2001 at 05:57:16, Tony Werten wrote:
>
>>On August 06, 2001 at 04:12:25, Adrian Smith wrote:
>>
>>>Hey all!
>>>
>>>I am having trouble working out how to represent moves (e2e4 etc)..
>>>As my programming experience isn't much yet, i decided to go with the 64 byte
>>>array as my board. Could anyone help me establish how to represent the moves in
>>>that format?
>>
>>Depending on the programming language it should be something like:
>
>I'm using ANSI C
>>
>>('a'+(from and 7))+('1'+(from shr 3))+('a'+(to and 7))+('1'+(to shr 3))
>
>hmm, i'm a little confused by that statement. Sorry, could you explain a little
>further? That'd be appreciated. Thanks

If you have a 8 by 8 board (a1=0,b1=1,a2=8,a7=56,h8=64) then the row and the
rank give the distance to a1.

fe c2 (=10) that means the 'a' plus (10 and 7=2) gives 'c' and '1' plus (12 shr
3=1) gives '2'

Tony

>>
>>cheers,
>>
>>Tony
>>
>>>
>>>Thanks
>>>
>>>
>>>    - Adrian Smith



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.