Thread: How to rotate a 64-bit BitBoard?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229

    How to rotate a 64-bit BitBoard?

    Hi,
    I am currently programming a chess game using bitboards.
    From what I have read on the internet, the best way (at least the most commonly used way) to generate moves for sliding pieces (rooks, bishops, and queens), involves the use of rotated bitboards. However, I cannot seem to come up with or find an efficient way to rotate bitboards.

    For people not into chess programming, what I want to achieve is to transform something like:
    Code:
    11111111 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    to:
    Code:
    10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000
    and:
    Code:
    00000001 00000001 00000001 00000001 00000001 00000001 00000001 00000001
    and:
    Code:
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 11111111
    Is there any efficient way to do this?

    Thank you very much.
    Last edited by cyberfish; 07-19-2007 at 08:59 AM. Reason: clarifying question

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 11-23-2007, 01:48 PM
  2. 64 bit programs
    By learning in forum C++ Programming
    Replies: 17
    Last Post: 05-10-2007, 11:26 PM
  3. A Question About Unit Testing
    By Tonto in forum C++ Programming
    Replies: 2
    Last Post: 12-14-2006, 08:22 PM
  4. bit patterns of negtive numbers?
    By chunlee in forum C Programming
    Replies: 4
    Last Post: 11-08-2004, 08:20 AM
  5. Array of boolean
    By DMaxJ in forum C++ Programming
    Replies: 11
    Last Post: 10-25-2001, 11:45 PM