Questions tagged [bitboard]

A bitboard is a data structure commonly used in computer systems that play board games.

A bitboard, often used for boardgames such as chess, checkers and othello, is a specialization of the bitset data structure, where each bit represents a game position or state, designed for optimization of speed and/or memory or disk use in mass calculations. Bits in the same bitboard relate to each other in the rules of the game often forming a game position when taken together. Other bitboards are commonly used as masks to transform or answer queries about positions. The "game" may be any game-like system where information is tightly packed in a structured form with "rules" affecting how the individual units or pieces relate.

85 questions
0
votes
1 answer

How to deal with very big Bitboards

I'm working on a 2-player board game (e.g. connect 4), with parametric board size h, w. I want to check for winning condition using hw-sized bitboards. In game like chess, where board size is fixed, bitboards are usually represented with some sort…
c.bear
  • 1,197
  • 8
  • 21
0
votes
2 answers

Algorithm Trax Winning Condition

I tried to implement the game Trax in C++. For those who do not know: http://www.traxgame.com/about_rules.php I have built the board so far and created the rules where I can put my next Tile and which one I am allowed to set. But now, I am…
MrCotton
  • 47
  • 1
  • 7
0
votes
1 answer

update attack bit board when one attack is updated

This is just a principle. I would like the attacked bitboard to be updated when one of the attacks bitboards (knight, bishop or pawn) is altered without having to repeat line 1. Is this possible? what is the best way to do this? In borg class way or…
0
votes
2 answers

Shifting only 1 bit in an integer by a specific number of places

I am creating a chess program and for the board representation I am using bitboards. The bitboard for white pawns looks like this: whitePawns=0x000000000000FF00; Now, if I want to move the white pawn on the square D4, I would have to shift the…
Rohit Shinde
  • 1,575
  • 5
  • 21
  • 47
0
votes
2 answers

Chess: bitscanning

I'm writing a chess engine in C# with magic bitboards and it's very slow right now. It takes 2 minutes to calculate perft 6 (119,060,324 positions) from the initial position when other engines can do it in 1-3 seconds. I'm currently using this…
0
votes
1 answer

Bitboard bitwise operations on 64 bit integers on iPhone 4 and 5?

I've got a rather interesting problem. I'm writing a chess engine using bitboards for iOS 7 which I want to work on the iPhone 4, 4s, 5, and 5s. Up till now I was doing all my testing in the iOS 64bit iPhone simulator, but I decided to run it on my…
AttilaTheFun
  • 701
  • 2
  • 11
  • 19
-1
votes
1 answer

Bitmaps/bitboards in Java

I'm programming a chess engine in Java and I would like to represent all pieces positions in one variable called bitmap or bitboard. In C++ I would simply use unsigned long, or so-called uint64_t. But because there are no unsigned variables in Java…
-1
votes
1 answer

Can BigIntegers be used in java to represent bitboards?

I recently started working on my school project which is writing a chinese chess game with a computer player in Java, I want to represent the board with bitboards, however since the board is 9x10, bigint or double aren't large enough to represent…
-1
votes
1 answer

Modify a bit at a given position in a int from left to right:

I have been trying to come up with a funtion were given a int it would modify a bit at a given position using bitwise operations: For example: modify_bit(int, pos) modify_bit(0b10000, 1) should return 0b11000 Or modify_bit(0b10000, 6) should return…
Jalrux
  • 7
  • 1
  • 9
-3
votes
1 answer

What is the maximum strength of a chess engine with a board representation using an 8 by 8 array?

I am trying to program my first chess engine, and I am using chessprogramming.wikispaces.com as a resource. My first attempt was to use bitboards considering their performance perks and for the fact that popular engines such as Deep Blue used…
zc917
  • 107
  • 1
  • 5
1 2 3 4 5
6