That's what I was saying. If the `l' at the end of the constant confused you, just ignore it: It's just C syntax for "long constant".
I think it should return 0x4000000000000000 which I'm interpreting that the horizontal mill for square 1 is closed.Ooops! It returns 0x4000000000000000l, of course. Sorry about that.
Yes.Using the same concept, is it possible to determine:
1. if mills are open (1 square is still empty, 2 owned by the player)
Yes.2. if mills are blocked (2 squares owned by the player, 1 by the opponent)
You can create a table of 24 numbers that contains bitboards indicating the adjacent squares for each square.3. get adjacent squares for a square
4. get empty squares
long empties = ~(bitboard[0]|birboard[1]);
Basically, yes.5. etc....
No, I am sure you can work around that.And if this would be possible, I'm assuming that shifting bits needs to be done and it wouldn't work on signed values.
Try to write code to solve one of these problems (say, find blocked mills). If you can't figure it out, ask again and I'll post some code.
EDIT: If you are going to perform all these other operations as well, I would forget about the trick of initializing the counters to 1, because it will complicate matters. So initialize to 0 instead, and now checking for mills becomes
long mills = (magic_sum + 0x1111111111111111l) & 0x4444444444444444l;