Questions tagged [programming]

Questions related to all aspects of writing software related to chess.

This includes discussion of algorithms, techniques, and architecture for writing or augmenting a chess engine, or the results and efficiency of these things. It also includes similar for user interfaces or any other tools that enhance the chess playing experience.

284 questions
12
votes
11 answers

Do chess programmes keep a history of the full board for each move?

I am creating a chess GUI for UCI engine as a hobby. I keep the history of moved positions (e.g., (4,6) -> (4,4) for the pawn in front of the white king moving forward 2 squares) and the type of the moved piece (e.g., pawn), and some minor states…
Damn Vegetables
  • 247
  • 2
  • 4
4
votes
5 answers

Storing chess position in 24 Bytes

I want a fast way to search how many times a certain position has appeared in a database of hundreds of thousands of games. I researched the best way to store positions in a database but all of the solutions were quite large and were stored as…
Marc
  • 79
  • 5
4
votes
1 answer

How to count pieces from PGN notation?

I am trying to figure out an algorithm to extract the number of each piece that both black and white have from a PGN file. Right now I have all of the moves tokenized(i.e. c("e4", "d6", "Nc3", "f5", "exf5", "Bxf5", "Qh5", "g6"...), but I'm not sure…
Peter Ni
  • 43
  • 3
4
votes
2 answers

How to calculate pinned chess moves

I am writing a legal move generator, and the last piece of the puzzle is preventing pinned pieces from being moved such that the king will be in check. I have read a lot of posts here and on stackoverflow and the only answers given seem to be vague…
Jack P
  • 141
  • 1
3
votes
1 answer

What is the format for USCF's Golden Database?

I was wanting to collect some statistics about players, and also just easily update player ratings for my local club. I tried the web crawls on USCF's Member Services Area (even using the thin pages http://msa.uschess.org/thin.php), but it takes too…
Icy Clench
  • 31
  • 2
1
vote
1 answer

Library to program mini games

In Corona times, it is not so easy to train children over the board. When that was possible, we used a lot of mini games with fewer pieces and most of the times a different goal. To bring those mini games online is not so easy, due to many…
mliebelt
  • 497
  • 3
  • 13
0
votes
1 answer

Confusing about perft test on Stockfish

I am writing a chess engine, and I am comparing my move generation results with Stockfish. I am currently stumped by this result. In this position 8/2p5/8/KP1p2kr/5p2/8/4P1P1/6R1 w - - from https://www.chessprogramming.org/Perft_Results, at depth 6,…
Ilan
  • 1
  • 1