TalkChess.com
Hosted by Your Move Chess & Games

Author Message
Gerd Isenberg

Joined: 08 Mar 2006
Posts: 1785
Location: Hattingen, Germany

Post subject: Re: post gone??    Posted: Wed May 02, 2007 6:08 pm

 hgm wrote: Depending on how you obtain that prior knowledge, you might arrange it such that it is also guaranteed that sq1 and sq2 are not neighboring squares on an anti-diagonal either, as in that case there are no in-between squares anyway. There is thus no reason to treat it differently from cases where sq1 and sq2 are not aligned on a ray. The disambiguation of that and the same-rank case would then no longer be needed. Also here the 'rotate' instructions could be useful, as you don't rely on bits being clipped off as the tabulated templates are shifted in position. That would save you ordering the squares. You would need twice as large a table, though.

Sounds great, you mean something like this?

 Code: u64 inbetweenBySignedDiff[2*64]; u64 inBetweenWithDistanceGr1(u32 sq1, u32 sq2) {     return _rotl64(inbetweenBySignedDiff[sq2-sq1+64], sq1); } sub rdx, rcx ; sq2-sq1 mov rax, [...+64*8+edx*8] rol rax, cl

But assuming there is no prior knowledge related to sq1, sq2, like a condition if distance(sq1,sq2) > 1 or the ray-type (rank, file, (anti-)diagonal), it becomes hard to use the rotate trick, due to the +-7 ambiguity. For instance to check (pseudo-)legality of queen-moves like Qh4-a4 or Qh4-g5.

The ambiguity disappears with 0x88-coordiates and one more double sized array...

 Code: u64 inbetweenBy0x88Diff[2*2*64]; u64 inBetweenWithDistanceGr1(u32 sq1, u32 sq2) {     return _rotl64(inbetweenBySignedDiff[sq2+(sq2&56)-sq1-(sq1&56)+127], sq1); }

... and it looks like a good compromize, specially if you already have 0x88.
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
Subject Author Date/Time
Tord Romstad Fri Apr 27, 2007 8:39 am
Mark Lefler Fri Apr 27, 2007 9:34 am
Tord Romstad Fri Apr 27, 2007 11:04 am
Pradu Kannan Fri Apr 27, 2007 11:15 am
jswaff Sat Apr 28, 2007 12:21 am
H.G.Muller Fri Apr 27, 2007 10:20 am
Tord Romstad Fri Apr 27, 2007 11:13 am
Pradu Kannan Fri Apr 27, 2007 11:18 am
Tord Romstad Mon Apr 30, 2007 3:01 pm
Robert Hyatt Sun Apr 29, 2007 12:34 am
Tord Romstad Mon Apr 30, 2007 3:14 pm
Robert Hyatt Mon Apr 30, 2007 5:08 pm
Guetti Tue May 01, 2007 8:26 pm
Gerd Isenberg Wed May 02, 2007 6:36 am
Guetti Wed May 02, 2007 7:54 am
H.G.Muller Wed May 02, 2007 3:47 pm
Re: post gone?? Gerd Isenberg Wed May 02, 2007 6:08 pm
Charles Roberson Fri Apr 27, 2007 1:45 pm
Vincent Diepeveen Sat May 19, 2007 5:20 pm
Robert Hyatt Mon May 21, 2007 5:34 pm
Tony Thomas Mon May 21, 2007 5:40 pm
Robert Hyatt Mon May 21, 2007 9:47 pm
Vincent Diepeveen Sat May 26, 2007 7:21 pm
Robert Hyatt Sun May 27, 2007 9:41 pm
Chan Rasjid Mon May 28, 2007 7:29 am
Tony Thomas Mon May 28, 2007 9:04 pm
Jacob Mon May 28, 2007 9:49 pm
Chan Rasjid Tue May 29, 2007 5:58 am
Robert Hyatt Tue May 29, 2007 3:18 pm
Chan Rasjid Tue May 29, 2007 4:09 pm
Robert Hyatt Tue May 29, 2007 9:23 pm
Steven Edwards Tue May 29, 2007 10:02 pm
Greg McGlynn Wed May 30, 2007 3:36 pm
Robert Hyatt Thu May 31, 2007 1:45 am
Steven Edwards Thu May 31, 2007 2:16 am
Robert Hyatt Tue May 29, 2007 3:15 pm
Jon Dart Fri Apr 27, 2007 6:25 pm
Michael Sherwin Fri Apr 27, 2007 11:32 pm
Robert Hyatt Sun Apr 29, 2007 12:38 am
Michael Sherwin Sun Apr 29, 2007 2:01 am
Robert Hyatt Mon Apr 30, 2007 12:41 am
frank phillips Sat Apr 28, 2007 10:38 am
Tord Romstad Mon Apr 30, 2007 3:22 pm
Robert Hyatt Mon Apr 30, 2007 8:59 pm
Michael Sherwin Tue May 01, 2007 9:55 am
Robert Hyatt Tue May 01, 2007 9:05 pm
H.G.Muller Tue May 01, 2007 11:38 am
Robert Hyatt Tue May 01, 2007 9:07 pm
Shaun Brewer Tue May 01, 2007 11:20 pm
Tord Romstad Fri May 11, 2007 8:16 am

 Jump to: Select a forum Computer Chess Club Forums----------------Computer Chess Club: General TopicsComputer Chess Club: Tournaments and MatchesComputer Chess Club: Programming and Technical DiscussionsComputer Chess Club: Engine Origins Other Forums----------------Chess Thinkers ForumForum Help and Suggestions
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2005 phpBB Group
Enhanced with Moby Threads