Questions tagged [programming]

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

Filter by
Sorted by
Tagged with
4
votes
1answer
101 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 ...
3
votes
1answer
108 views

Python-chess : Are the move scores enough to rank moves from the most to least likely moves played by an engine?

My goal is to make a script to finding the most and least likely move an engine will play, and then make a list it. I tried using the scores to make such a list, with the best score equalling the most ...
2
votes
1answer
156 views

Python-chess : how to get a list for the best engine moves

I am working on a simple cheat detection script to find if a user used one of the top engine moves in a game, so I found this great python-chess library Additionally, I found this example to getting ...
2
votes
0answers
92 views

Wrong perft result?

I'm writing a chess engine for fun. Currently I'm finishing writing the move generator. During the research I leaned about PERFT for debugging my software. Indeed, I found many bugs, some of them was "...
3
votes
0answers
39 views

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 ...
4
votes
1answer
88 views

Leela Chess PUCT Mechanism

How do we know w_i which is not possible to calculate using the tree search only? From the lc0 slide, w_i is equal to summation of subtree of V ? How is this equivalent to winning ?
5
votes
1answer
262 views

Converting from Algebraic notation to Coordinate notation

I saw this thread: Converting square notation to algebraic notation programmatically Unfortunately, it's the reverse of what I need to do. Given a FEN and an Algebraic move, I need to generate the ...
6
votes
2answers
136 views

How to evaluate and comment moves in PGN format?

I want, with Python-chess, to evaluate any movement of some game and generate the PGN with analysis, as Chess.com does in its analysis. For example, i played one game with fools mate and they ...
-1
votes
1answer
156 views

Python and Stockfish [duplicate]

I am trying to get Stockfish to work in Python 3. Just to get started on my project, I tried to have Stockfish think until a depth of 20. However, the program instantly returns that Stockfish ...
2
votes
2answers
215 views

Where is the neural network used in MCTS?

Where does an engine (such as AlphaZero) use its neural network in MCTS? It shouldn't be needed to evaluate positions reached via MCTS, since I'm under the impression that only terminal game states ...
3
votes
2answers
328 views

AlphaZero and the revenge of the Artificial Intelligence

Answering this question, @SmallChess offered this answer: Before Google's chess journey, the chess engine community believed: AI chess will not beat classical programming because neural networks ...
0
votes
2answers
124 views

Testing an engine (UCI) against an older version of itself

I am making modifications to a chess engine. I want to get quick feedback on whether the modified version seems stronger than an unmodified version or not, by fighting the older version multiple ...
2
votes
1answer
92 views

How can I get multiple computer recommended lines in python-chess module?

In python-chess you can communicate with the engine on a given position. However the method presented in https://python-chess.readthedocs.io/en/latest/uci.html using the engine.go() function with only ...
4
votes
2answers
192 views

What's the rationale behind chess engines conditionally allowing threefold repetitions when assigning a draw score?

When a chess engine sees a position p repeated once (i.e. position p occurred twice) it immediately assigns the second occurrence of position p a draw score. This makes sense because position p doesn'...
1
vote
1answer
162 views

Is this the correct flow of a chess game?

I am trying to program a chess game as a challenge to myself, however, I am unsure if I have all the moves correct to play a legal game (not any advanced moves, that would be a challenge for another ...
5
votes
3answers
395 views

Is dead position problem solvable?

In chess, there are some dead positions (FIDE Laws of Chess). Arbiter or players will terminate the game OTB, but is it possible to do computer solution for dead position detection? If it is, then how?...
1
vote
2answers
175 views

Android Stockfish communication works differently than on PC? [closed]

How is number of threads to use written on Android versions of Stockfish? Whole communication works but somehow I still can't change number of threads. I even have working code for PC version of ...
1
vote
0answers
45 views

Chess engine used to point out common tactical blunders [duplicate]

Does anyone know of chess engines that have been programmed to point out a tactical blunder in plain English? I.e. “you missed a skewer”, or something to that effect. Not simply “this move -3”. ...
1
vote
2answers
98 views

Can an Optimal Stopping strategy be applied to search functions?

Can the solution to the famous Secretary Problem be applied to the search function of a chess engine? Rejecting the first 37% moves and choosing the best one after that,or maybe even just checking the ...
0
votes
1answer
104 views

Is there a way to get MANY and FAST (but not deep) position evaluations in javascript?

I am working on a statistical chess project that needs to evaluate many (about 20-30) different positions per turn. They do not need to be deep but fast. Is there a possibility to use engines (...
3
votes
0answers
155 views

Elo rating software with automatic random matchups

This question is not about chess per se, but I am looking for a software that could generate random matchups through a list of 200ish options/people, then I could choose the winner and it would rank ...
4
votes
1answer
139 views

Standard for receiving live chess broadcast

I was making live broadcast recent days and I'm quite surprised how it technically worked. We were downloading whole new PGN file every 5 seconds with format shown it the code below. Is this how ...
0
votes
1answer
115 views

convert stockfish pv output to show piece names [duplicate]

What are suggested coding snippets to add pieces to pure algebraic notation (this would change g1f3 to Nf3) when using the chess.js and chessboard.js (javascript) interface. Stockfish uses this type ...
5
votes
2answers
2k views

Chess GUI that allows null-moves

Is there a GUI that allows null-moves as legal moves? Of course for engines the null-move heuristic already is an established technique.
5
votes
3answers
633 views

How can minimax chess engines do alpha-beta pruning without reaching the final positions?

In order to calculate far ahead, minimax chess engines must perform alpha-beta pruning, where they don't calculate positions that are obviously winning or obviously losing. Without doing pruning, ...
7
votes
2answers
448 views

How do chess engines evaluate a position if the position is in the middle of an exchange?

In the minimax algorithm, chess engines do a depth-first search as far as they can calculate ahead, and then evaluate all these final positions. Then, using these evaluations they work backwards one ...
4
votes
1answer
445 views

Four player chess (team): is there some opening theory written somewhere?

I am an active player on four player team chess on chess.com (my Elo is currently 2095). I am planning to write something about theory of opening of this chess variant. Question is, do you know if ...
3
votes
2answers
93 views

Coordinate-style move output from chess engine, to control robot

I'm using gnuchess to decide which move a program should make, and I'm using its output to control a robot arm (to execute the move on a real board). However, gnuchess outputs SAN (Standard Algebraic ...
4
votes
1answer
183 views

Output whether the best move is “much better” or only “slightly better” than the other moves

On Oct 31, 2014, Tord Romstad wrote: The moves are not searched in descending order from best to worst. Stockfish has no idea which move is the second, third best, etc., and it doesn't have any ...
3
votes
1answer
134 views

Data set of board representations at checkmate?

I would like to do a simple project by looking at the pieces at play when checkmate occurs. I have been scouring the internet for a dataset of standard chess games from which I can retrieve the ...
6
votes
4answers
290 views

Formulating a Precise Definition of “Space” in Chess

Premise I have always enjoyed playing recreational chess, so I know the basics and some general tactics / strategies. It was only recently though that I have gone more hardcore, so to speak, with my ...
1
vote
1answer
172 views

Tips for debugging and progressing a chess engine's implementation

As I mentioned in previous questions I'm currently following this tutorial for building my chess engine. The code was written in C#, but mine is in C++ and I'm in the phase of finalizing the board / ...
0
votes
2answers
183 views

Please critique my Engine game

Two of my engine's played against Garbo engine. (without a opening Book on my part.) Both lost :( Which played better? I need a comparative analysis. Both shared the same evaluation. frankenstein ...
3
votes
1answer
434 views

Differences between chess engines

In what way do major chess engines differ from one another? Do they all use the same algorithm and the same evaluation function, differing only in parameters/weights?
1
vote
2answers
70 views

Changing UCI output to include piece names

UCI output from engines is generally raw in the form of g1f3 and e2e4 representing Nf3 and Pe4. One engine I saw (lozza) sends its PV output with the piece names. Others, like Stockfish, don't ...
2
votes
3answers
254 views

FEN inverter website/page?

This board shows the black pieces on the bottom, but the white pieces are supposed to be there; I accidentally set up the board so that white's pieces are on the black side. I am looking to flip the ...
4
votes
1answer
169 views

Backwards Chess Program

Is there a chess program where you can create a position and the program creates a game, expecting the best possible moves to get there, or the most common? A problem I would see is some positions ...
2
votes
2answers
800 views

How to generate hash keys for chess positions

Is there a standardized method for generation of hash keys for chess positions. I want to implement hash key generation in my program, so wanted to know the best way to do it. It would be great if ...
4
votes
1answer
333 views

How to iterate over all FENs in Syzygy table?

This is a programming question related to chess syzygy endgame tables. I believe that it is better suited on chess stack exchange than on SO because it is too specific to chess and asks for a ...
3
votes
2answers
323 views

How to write a simple chess engine to statically evaluate a position?

I want to evaluate positions statically. So I've written a code which evaluates from a FEN string. However it is a tedious to copy FEN and then paste for a complete game. So I wanted to know if it ...
1
vote
1answer
93 views

Getting started in position-counting by computer

I have quite a bit of programming background, and even game programming background, but have never looked at a real chess engine before. I recently stumbled on this puzzle-question, which asks for ...
1
vote
2answers
391 views

How do I get Stockfish to show notes like it does on Lichess?

I want to write a program to stop a chess game if Stockfish decides that checkmate is unavoidable for a player as a learning exercise. I downloaded Stockfish for Mac and it gives what it thinks is the ...
16
votes
5answers
1k views

How did the engines improve since Deep Blue?

Computer chess engines have gotten better since Deep Blue beat Kasparov in 1997. Did the algorithms get better, or were the improvements mostly due to the same algorithms running faster thanks to ...
0
votes
1answer
70 views

Possible chess positon after X ply?

I've started to code my own little engine recently and am now working on a perft function which simply sees how many moves there are. Trying to get correct results I searched online for the correct ...
1
vote
1answer
583 views

What is the problem with my negamax implementation?

I am currently attempting to make a basic chess engine in Python (Learning some basic concepts), but for some reason the engine is suicidal and does not detect the scholars mate. I am using python-...
7
votes
1answer
3k views

Stockfish evaluation of a position from PGN

I am trying to get Stockfish's evaluation of a board position(which is in PGN format) using command line.I know it accepts board position in FEN format, but is there any way i can provide PGN format? ...
4
votes
1answer
720 views

What is alternative to Zobrist hashing?

Zobrist hashing is very good method save position but it is not good to read position - is any good alternative to this algorithm which allow to store and restore position with minimum of bits. For ...
2
votes
1answer
272 views

Estimating probability of player playing move in the opening

For position you never played, book probability is perfectly fine for me. The question starts when you already played position x-times. I'm looking for function that will update book probabilities ...
2
votes
1answer
565 views

How are centipawns calculated?

I found on the Web some information what centipawns are. But how exactly programs calculate this loss? How can I recognize if one move will bring less centipawn loss that an another? Assuming both ...
5
votes
3answers
2k 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 ...