Questions tagged [bitboard]

For questions about bitboards and using bitboards

Filter by
Sorted by
Tagged with
2
votes
1answer
145 views

Bitboard chess engine design

What are the best approaches to designing a chess engine? What classes/structures should it have? How are they connected to each other? I'm building a chess engine but I often find myself overwhelmed. ...
4
votes
1answer
162 views

Move generation for sliding pieces and Hyperbola Quintessence

I'm working on a bitboard-based chess engine at the moment and I have managed to generate pseudo-legal moves for knights, kings and pawns. However, I'm still trying to wrap my head around sliding ...
0
votes
1answer
67 views

Search function for chess engines

I'm creating a bitboard based chess engine in c++ and I'm trying to write the search function. It currently looks something like this double search(Position& pos, int depth, double alpha, double ...
1
vote
1answer
68 views

Evaluation function in a bitboard based chess engine

How do you go about writing an evaluation function for a bitboard bases chess engine? I want to start of simple and only evaluate based on piece value, and where the pieces stand. For example a knight ...
1
vote
1answer
77 views

Bitboards and sliding piece attacks

I have been searching about bit boards and piece attacks. The concept of using a bitwise and to find the set of attacked pieces (ie: knightAttackSet & opponentPieces) is really elegant and ...
1
vote
0answers
174 views

Magic bitboards not speeding up my engine

I'm new to writing chess engines but just recently finished my first program. It ran slowly however so I switched over to bitboards, and now to magic bitboards. I used the chess programming wiki a lot....
2
votes
1answer
153 views

Fastest way to parse a bitboard

I am making a chess engine, and for now I’m working on the move generation. I’m using bitboards, and so for example my magic bit boards file for a knight on d4 is 00000000 00000000 00101000 01000100 ...
4
votes
1answer
375 views

How do I complete this implementation of magic bitboards?

I'm currently coding a chess engine in C++, and have run into a bit of trouble with my magic bitboard implementation. So far, I have a function that calculates blockerBoards (all the possible pieces ...
2
votes
1answer
134 views

How can I convert a possible pieces' moves to an actual move in a bitboard?

If I have a bitboard (e.g. for knight squares he can move to) like this: 00000000 00000000 00000000 00000000 00000000 01000000 00100000 N0000000 How can I "convert" it into a move or "...
1
vote
1answer
109 views

How do I find bitboard attack maps non-manually?

I am writing a C++ chess engine based on the magic bitboard, where ordering for bitboards is from LSB to MSB in Little-Endian Rank-File mapping. I'd like to have a 6x64 dimension 2D array for all ...
1
vote
3answers
372 views

Fastest way to generate castling moves in a computer chess engine

I am currently developing a Bitboard chess engine using C++. I am in the process of creating the move generator function. I have completed most of it and only the casting part is left. I have used ...
3
votes
1answer
137 views

How do I apply moves (bitboard) and continue searching? My current attempt is throwing a strange error!

Explanation I have a list of all possible current moves in a position. At each node, I want to then generate all possible moves and continue. The problem is that my code is modifying the list of moves ...
1
vote
1answer
209 views

How to store moves for a magic bitboard system?

I am currently trying to implement magic bitboards into my chess engine. Let's just talk about rooks here. Given a square, what I can currently do is: -Calculate the sliding moves on an empty board. ...
4
votes
2answers
940 views

Quickly converting board to bitboard representation using python-chess library

I would like to convert a given chess board into its bitboard representation, but my implementation is rather slow. Here is what I'm doing (using the python-chess package): board = chess.Board('...
3
votes
1answer
268 views

Magic Bitboards, Feeding in Randoms - Why have to find magic instead of just loading from disk?

I read about Looking for Magics for Magic Bitboard, they mentioned the method "Feeding in Randoms". As I understand, this method works like this: label RETRY; magic = random();//trial for (all ...
5
votes
1answer
358 views

Are these magics wrong?

I am working on my chess engine and wanted to finally implement magic bitboards to get a huge increase in performance. Basically I was writing a method to check if a number can be used as a magic for ...
2
votes
1answer
158 views

Can engines use the current pawn structure to refine its search/eval?

As I understand it, engines use so-called "bitboards" to generate the current position & possible moves. I'm wondering if any engine uses the pawn bitboard to refine its search and eval. To ...
5
votes
2answers
569 views

Chess Engine: Generate a Bitboard of Pinned Pieces

I'm currently working on a chess engine and have a pseudo-legal move generator working. I'm looking for a way to efficiently generate a bitboard of pinned pieces, so I could skip them when generating ...
5
votes
3answers
4k views

What's the right approach of storing moves generated using bitboards?

I am building a chess engine from scratch using bitboards and, so far I am able to generate pawns moves. But, I am stuck on what should I do after finding all possible moves for pawns. Right now the ...
1
vote
1answer
3k views

Understanding magic bitboard

I have read a lot of stuff about magic bitboard but some stuff is not clear. A lot of authors say to create the move masks for the piece avoiding the border positions. So, for a bishop at D3 the move ...
4
votes
2answers
1k views

Building a chess using magic bitboard... how do I know if the movement is valid

OK I have read a lot of things on the web most of them using Java that doesn't have unsigned int. I am working on Objective-C that has unsigned int. Lets consider the following scenario. The board ...
7
votes
3answers
5k views

Representing Moves found via BitBoards, applying them, and removing them

I understand how to find all valid moves for all pieces on the board. For example I know that a certain knight can hit all of the 1's in this board 01000000 00100000 N0000000 00100000 01000000 ...
9
votes
1answer
2k views

Find magic numbers for bitboards

I am writing a C++ chess engine and I am looking for magic numbers for Little-Endian Rank-File Mapping bitboards to generate moves for sliding pieces. The rival chess website gives magic numbers but ...
10
votes
2answers
15k views

How to represent chess state with a bitboard

I'm interested in programming a chess engine and using bitboards to represent the state of the game. I know there are a few open source chess engines that use bitboards, but its not so easy to look at ...