Questions tagged [programming]

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

Filter by
Sorted by
Tagged with
3
votes
1answer
58 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 ...
0
votes
1answer
67 views

Program that will give all available moves given the state of a board, including check

I am trying to write a program that will give out every possible move for every piece (one move deep) given the state of a board. I have already done this such that it works with everything except ...
2
votes
3answers
95 views

How to use Arena GUI outputs in a python program

I'm currently developping a self-playing chessboard on which I'd like to implement an AI (currently it's Stockfish. I would like to know how I could, if I can, export Arena GUI's (other ideas are ...
5
votes
3answers
126 views

How do generic game engines work?

The evaluation functions for chess usually includes chess specific knowledge. However, Zillions of Games is able to play any game based only on a description of how the pieces move and winning/losing/...
1
vote
2answers
144 views

How many moves can be expressed with algebraic chess notation?

I am wanting to write a chess engine (see here: Creating chess engine, machine learning vs. traditional engine?). The first step I am doing is taking a position in as an FEN and converting this ...
1
vote
2answers
82 views

When to use Clear Hash

I am developing a program that analyzes games sequentially, i.e. one game after another. Below are the parameters. Engine: Stockfish 10 Threads: 2 Hash Table: 4000 Depth: 30 My question is about ...
2
votes
2answers
126 views

How can I set up en passant in Popeye engine?

I want to solve a problem with Thomas Maeder's excellent Popeye engine, and to specify that a possible en passant in the diagram is ok. How can I do this please? The documentation seems opaque. Thanks ...
17
votes
4answers
5k views

Creating chess engine, machine learning vs. traditional engine?

I am both an avid chess player and computer programmer. I would say that playing chess and programming are the two things I spend the most time doing. Naturally, I am wanting to create my own engine ...
2
votes
0answers
110 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 "...
2
votes
2answers
198 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 / ...
3
votes
1answer
701 views

Efficient ways to go from pseduo legal to fully legal move generation [closed]

so I've written an entire pseudo legal move generator as well as a simple gui to interface with. I also have my AI only play the best move available without going into a minimax tree. Before I begin ...
6
votes
1answer
394 views

Three-fold repetition and null move

Added transposition table (this was tested alone and worked as expected), three fold repetition and null move pruning in my engine and wins more games but some of them end with three fold repetition ...
4
votes
3answers
3k 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 ...
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 ...
2
votes
2answers
216 views

If a pawn promotes to a checking piece while also revealing a check, it is a double check?

I'm writing a chess engine just for fun, and during the validation of movement generation, I found some positions in Perft Results that differ from what my engine is producing. As an example, take ...
6
votes
2answers
1k views

What are the common mistakes make by chess engines at ELO range 1500 - 1800?

I'm a software developer and occasional chess player at elo rating 1500. Chess engines of different level play different type of games with some mistakes according to that given level. I'm ...
3
votes
4answers
2k views

Programming three-fold repetition for my chess engine

I'm making a chess engine that has to implement a three-fold repetition as my AI vs AI engine repeats the same moves over and over again (Have a look at my post here - My chess AI makes the same ...
5
votes
4answers
375 views

Coding chess engine

I have always wanted to start coding a simple chess engine. I do have basic understanding about the general architecture of such a program, but I would love to see some examples first. Anyone have ...
3
votes
1answer
130 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 ...
4
votes
1answer
112 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 ...
2
votes
1answer
305 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 ...
4
votes
4answers
2k views

Which is the most CPU efficient chess engine?

I am learning artificial intelligence and chess programming. I want to analyze the architecture and read the code of existing chess engines. But I am confused between multiple choices. There are ...
4
votes
1answer
93 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 ?
4
votes
2answers
295 views

Compiling asmFish on macOS

I have been able to make a custom build of asmFish on Linux. However, I have been unable to do so on macOS. I've seen a Mac version of the FASM compiler on the Internet. But when I tried using it for ...
5
votes
1answer
713 views

Collecting principal variations during search and using them in ordering?

In an Alpha Beta search in that utilizes a Negamax framework, how does one collect principal variations to use in move ordering, and how does one use them, without using a transposition table? ...
7
votes
2answers
1k views

Is there an online chess evaluation engine with a REST API?

Is there an online chess evaluation engine with a REST API? I'd like to be able to send a game or position (with castling ability presumably) to a simple REST API and get back the positional ...
3
votes
0answers
166 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 ...
5
votes
1answer
276 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
194 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
185 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
283 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
343 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
139 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
5answers
3k views

How do I check if a move is legal using Stockfish?

Let us say that I input a wrong move in Stockfish. What answer will Stockfish send me back? Or is there a function to check if a move is bad? People, I found a solution by myself.
5
votes
3answers
3k views

What is the optimal way to use Stockfish programmatically?

I have Stockfish compiled on my machine. Instead of just running the Stockfish program in the terminal, is it possible to interact with it in a separate program? For example, some basic things I ...
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 ...
2
votes
1answer
100 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 ...
6
votes
3answers
403 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?...
4
votes
1answer
770 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 ...
4
votes
2answers
206 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'...
2
votes
1answer
177 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 ...
1
vote
2answers
195 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
47 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”. ...
4
votes
1answer
452 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
364 views

Is there a free downloadable mini-chess program or 'chess engine'?

The fascinating miniature chess or mini-chess ' that is chess on a 6 by 6 board. I know there are tons of decent chess programs but has anyone written a decent chess program for mini-chess. Is there ...
1
vote
2answers
100 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 ...
10
votes
5answers
14k views

Chess engine with API

I am looking for a chess engine which provides a normal API which I can use with some high level programming language like C# or python. I went through the list of leaders (Houdini, Komodo, Stockfish ...
2
votes
3answers
439 views

Duplicating the game analysis output on lichess

I'd like to automatically generate move by move analysis (based on my past games) like they have on lichess for imported games. My guess is that I need to run a full stockfish analysis for each move (...
0
votes
1answer
117 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 (...
5
votes
3answers
694 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, ...