ChessUSA.com TalkChess.com
Hosted by Your Move Chess & Games
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Is there such a thing as branchless move generation?
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions Flat
View previous topic :: View next topic  
Author Message
Edmund Moshammer



Joined: 03 Dec 2007
Posts: 598
Location: St. Gallen, Switzerland

PostPost subject: Re: Is there such a thing as branchless move generation?    Posted: Thu Jun 07, 2012 10:57 pm Reply to topic Reply with quote

I would go for the 0x88 board approach.

make an array that for each piece stores whether it can slide
make an array that for each piece for each direction stores the move increment

Loop over every square
Loop over all 8 directions

int move_is_legal = (from == correct piece color) && direction is legal //(e.g. a rook can only have 4 directions, the other 4 entries in the direction array could be 0)

Loop over all 7 moves per direction {

store the move in the movelist

move_is_legal &= (slide == 0 || canslide) && (to is on the board) && (to is not own piece)

increment movecounter iif move_is_legal

move_is_legal &= (to is opponent piece)

}
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Subject Author Date/Time
Is there such a thing as branchless move generation? John Hamlen Thu Jun 07, 2012 7:50 pm
      Re: Is there such a thing as branchless move generation? Gerd Isenberg Thu Jun 07, 2012 8:44 pm
            Re: Is there such a thing as branchless move generation? John Hamlen Thu Jun 07, 2012 10:18 pm
      Re: Is there such a thing as branchless move generation? Edmund Moshammer Thu Jun 07, 2012 10:57 pm
            Re: Is there such a thing as branchless move generation? John Hamlen Fri Jun 08, 2012 8:21 am
                  Re: Is there such a thing as branchless move generation? Sven Schüle Fri Jun 08, 2012 9:21 am
                        Re: Is there such a thing as branchless move generation? John Hamlen Fri Jun 08, 2012 10:31 am
                              Re: Is there such a thing as branchless move generation? Edmund Moshammer Fri Jun 08, 2012 10:41 am
                                    Re: Is there such a thing as branchless move generation? John Hamlen Sat Jun 09, 2012 1:17 pm
                              Re: Is there such a thing as branchless move generation? Daniel Shawul Fri Jun 08, 2012 11:12 am
                                    Re: Is there such a thing as branchless move generation? Edmund Moshammer Fri Jun 08, 2012 11:18 am
                                          Re: Is there such a thing as branchless move generation? Daniel Shawul Fri Jun 08, 2012 3:39 pm
                                                Re: Is there such a thing as branchless move generation? Vincent Diepeveen Sat Jun 16, 2012 9:07 am
                                                      Re: Is there such a thing as branchless move generation? Daniel Shawul Sat Jun 16, 2012 11:27 am
                                                            Re: Is there such a thing as branchless move generation? Vincent Diepeveen Sat Jun 16, 2012 11:35 am
                                    Re: Is there such a thing as branchless move generation? John Hamlen Sat Jun 09, 2012 2:43 pm
                                          Re: Is there such a thing as branchless move generation? Daniel Shawul Sat Jun 09, 2012 6:02 pm
                                                Re: Is there such a thing as branchless move generation? John Hamlen Sun Jun 10, 2012 2:21 pm
                                                      Re: Is there such a thing as branchless move generation? Daniel Shawul Sun Jun 10, 2012 6:33 pm
                                                            Re: Is there such a thing as branchless move generation? Daniel Shawul Sun Jun 10, 2012 7:16 pm
                                                                  Re: Is there such a thing as branchless move generation? Edmund Moshammer Sun Jun 10, 2012 9:24 pm
                                                                        Re: Is there such a thing as branchless move generation? Daniel Shawul Sun Jun 10, 2012 9:54 pm
                                                                  Re: Is there such a thing as branchless move generation? John Hamlen Sun Jun 10, 2012 10:14 pm
                                                                        Re: Is there such a thing as branchless move generation? Daniel Shawul Mon Jun 11, 2012 12:49 am
                                                                              Re: Is there such a thing as branchless move generation? John Hamlen Mon Jun 11, 2012 12:43 pm
                                                                                    Re: Is there such a thing as branchless move generation? Daniel Shawul Mon Jun 11, 2012 2:41 pm
                                                                                          Re: Is there such a thing as branchless move generation? John Hamlen Mon Jun 11, 2012 10:12 pm
                                                                                          Re: Is there such a thing as branchless move generation? Daniel Shawul Mon Jun 11, 2012 11:12 pm
                                                                                          Re: Is there such a thing as branchless move generation? John Hamlen Mon Jun 11, 2012 11:41 pm
                                                                        Re: Is there such a thing as branchless move generation? Vincent Diepeveen Sat Jun 16, 2012 9:56 am
                                                            Re: Is there such a thing as branchless move generation? John Hamlen Sun Jun 10, 2012 10:58 pm
                                          Re: Is there such a thing as branchless move generation? Gerd Isenberg Sat Jun 09, 2012 7:48 pm
                                                Re: Is there such a thing as branchless move generation? John Hamlen Sun Jun 10, 2012 5:28 pm
            Re: Is there such a thing as branchless move generation? Edmund Moshammer Fri Jun 08, 2012 10:32 am
                  Re: Is there such a thing as branchless move generation? John Hamlen Sat Jun 09, 2012 2:57 pm
                  Re: Is there such a thing as branchless move generation? Vincent Diepeveen Sat Jun 16, 2012 8:57 am
      Re: Zeta CL uses Magic Bitboards Srdja Matovic Mon Jun 11, 2012 2:53 pm
            Re: Zeta CL uses Magic Bitboards Gerd Isenberg Mon Jun 11, 2012 8:55 pm
                  Re: Zeta CL uses Magic Bitboards Srdja Matovic Mon Jun 11, 2012 9:35 pm
                        Re: Zeta CL uses Magic Bitboards Daniel Shawul Mon Jun 11, 2012 11:26 pm
                              Re: Zeta CL uses Magic Bitboards Srdja Matovic Tue Jun 12, 2012 1:16 am
                              Re: Zeta CL uses Magic Bitboards Gerd Isenberg Tue Jun 12, 2012 6:58 am
                                    Re: Zeta CL uses Magic Bitboards Daniel Shawul Tue Jun 12, 2012 1:46 pm
                                          Re: Zeta CL uses Magic Bitboards Srdja Matovic Tue Jun 12, 2012 2:35 pm
                                                Re: Zeta CL uses Magic Bitboards Daniel Shawul Tue Jun 12, 2012 4:37 pm
                                                      Re: Zeta CL uses Magic Bitboards Vincent Diepeveen Sat Jun 16, 2012 8:46 am
                                                            Re: Zeta CL uses Magic Bitboards Daniel Shawul Sat Jun 16, 2012 11:17 am
                                                                  Re: Zeta CL uses Magic Bitboards Vincent Diepeveen Sat Jun 16, 2012 11:30 am
                                                                        Re: Zeta CL uses Magic Bitboards Daniel Shawul Sat Jun 16, 2012 1:56 pm
                                                                              Re: Zeta CL uses Magic Bitboards Vincent Diepeveen Sat Jun 16, 2012 2:51 pm
                  Re: Zeta CL uses Magic Bitboards vs Kogge-Stone Srdja Matovic Tue Jun 12, 2012 1:05 am
                        Re: Zeta CL uses Magic Bitboards vs Kogge-Stone Gerd Isenberg Tue Jun 12, 2012 6:31 am
            Re: Zeta CL uses Magic Bitboards John Hamlen Mon Jun 11, 2012 10:35 pm
                  Re: Zeta CL uses Magic Bitboards Daniel Shawul Mon Jun 11, 2012 11:00 pm
      Re: Is there such a thing as branchless move generation? Vincent Diepeveen Sat Jun 16, 2012 8:40 am
      Re: Is there such a thing as branchless move generation? Vincent Diepeveen Sat Jun 16, 2012 9:23 am
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions

 
Jump to:  
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