Free Bitboard Viewing Utility...

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

mar
Posts: 2555
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Free Bitboard Viewing Utility...

Post by mar »

Gerd Isenberg wrote:8 orthogonal mapping modes:
LERF, LERBEF
BERLEF, BERF
LEFR, LEFBER
BEFLER, BEFR
unary flip and mirror.
https://chessprogramming.wikispaces.com/Bibob
Awesome, Gerd.
Thanks! :)
User avatar
cms271828
Posts: 316
Joined: Wed Apr 12, 2006 10:47 pm

Re: Free Bitboard Viewing Utility...

Post by cms271828 »

I like this browser version tool:

http://butterflychess.altervista.org/bi ... tml?type=0

But I found a small problem with it..
The highest bit(63) has decimal value 2^63,
But I'm guessing typical programming languages would use -2^63 for this bit, to give the nice range -2^63 ... 2^63-1
Colin
AlvaroBegue
Posts: 931
Joined: Tue Mar 09, 2010 3:46 pm
Location: New York
Full name: Álvaro Begué (RuyDos)

Re: Free Bitboard Viewing Utility...

Post by AlvaroBegue »

There are signed and unsigned types, and an unsigned type should be used for bitboards. If you use an unsigned type, the 64-bit integer with the highest-bit set represents +2^63.
User avatar
cms271828
Posts: 316
Joined: Wed Apr 12, 2006 10:47 pm

Re: Free Bitboard Viewing Utility...

Post by cms271828 »

Well that's true in C, but I'm using java.

A "long (64 bit)" in java is from -2^63 to 2^63-1, so I don't think I have any other choice but to use negatives (when the highest bit is 1).

It makes no difference to my code, but I would have to use that bitboard tool with caution.
Colin
AlvaroBegue
Posts: 931
Joined: Tue Mar 09, 2010 3:46 pm
Location: New York
Full name: Álvaro Begué (RuyDos)

Re: Free Bitboard Viewing Utility...

Post by AlvaroBegue »

cms271828 wrote:Well that's true in C, but I'm using java.

A "long (64 bit)" in java is from -2^63 to 2^63-1, so I don't think I have any other choice but to use negatives (when the highest bit is 1).

It makes no difference to my code, but I would have to use that bitboard tool with caution.
I would use Java with caution. :)

By using a signed type, shifts to the right behave funny, propagating the sign bit instead of introducing zeros at the left end.
User avatar
cms271828
Posts: 316
Joined: Wed Apr 12, 2006 10:47 pm

Re: Free Bitboard Viewing Utility...

Post by cms271828 »

Yes, thats why you can use >>> to bring in 0's, or >> to bring in 1's (if its already negative).
Colin