Questions tagged [programming]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
121 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
733 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, ...
4
votes
1answer
147 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
129 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 ...
2
votes
3answers
274 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 ...
7
votes
4answers
322 views

Checkless Chess

Is there any material difference between chess the way it is now versus doing away with check and checkmate and defining victory as simply capturing the opponent's King? Assuming an available King ...
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.
4
votes
1answer
185 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 ...
7
votes
2answers
494 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 ...
3
votes
2answers
103 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 ...
3
votes
1answer
139 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
304 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 ...
9
votes
3answers
795 views

Unit Testing a chess board representation

So this is a bit of outlier question. I am writing a chess library, essentially from scratch. You can find much of the code here, with the intention of using it for a GUI and/or an engine. (The game ...
8
votes
3answers
2k views

Which interface protocol should I implement for my chess engine?

I am writing a chess engine in C++ https://github.com/RomainGoussault/Deepov. I know there are several interface protocols out there (UCI, Winboard protocol, etc) and I don't know which to implement. ...
3
votes
2answers
897 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 ...
1
vote
3answers
348 views

Make Arena send last move to chess engine

I am building a chess engine using AI and have succesfully connected it to the Arena Gui, by implementing the UCI protocol. My goal is to train my AI by facing other AIs that Arena offers. Everything ...
2
votes
2answers
2k views

C++ vs Java Engine move generation performance

I've just finished translating my Java Engine to C++11, expecting great speed improvements in move generation. The code is very straightforward and uses a pre-generate bitboards approach. I also ...
0
votes
2answers
184 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 ...
1
vote
3answers
191 views

Python-chess is_zeroing and is_capture operation outputs

I'm using python-chess to analyze a game. I have my code like this, and I expect 3 boolean outputs. print("is_castling: " + unicode(board.is_castling(node.move))); print("is_zeroing: " + unicode(...
3
votes
1answer
458 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
74 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 ...
4
votes
1answer
170 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 ...
4
votes
1answer
340 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
342 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
95 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
410 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 ...
1
vote
1answer
72 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 ...
2
votes
1answer
290 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 ...
1
vote
1answer
623 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-...
8
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? ...
7
votes
2answers
2k views

Where can I find databases of tactical problems, categorized and ranked by difficulty?

I'm toying with the idea of building a tactical training tool. For my idea to work, I need positions that are categorized by motif and difficulty. A lot of tools seem to have this, and I doubt they'...
2
votes
1answer
586 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 ...
3
votes
3answers
2k views

How to send uci messages from c# app to stockfish on android?

I downloaded the binary of Android Stockfish arm64-v8a and looked in the CPP source files. In main() there is all initialization, and then there is UCI::loop(), which catches standard input with ...
3
votes
1answer
286 views

Gull engine : Which depth value to set 6 difficulty levels?

We are installing the Gull engine for some chess enthusiasts in an organization. We would like to set 6 difficulty levels from beginner to master using depth. Is there someone who can advice us about ...
4
votes
1answer
484 views

Using Stockfish in c# android (xamarin) app

I looked at this question Implement a chess app for Android with Stockfish but it doesn't seem to be answering what I want to ask. Maybe part of my question is topic for stack overflow forum, but ...
1
vote
3answers
320 views

Chess Psychology

I have a friend who is an improving chess player. He wants to progress in his game. The problem with him is that he plays really good with much stronger opponents but, often lose many games ...
2
votes
2answers
120 views

Analysing Positions in Databases with a program

I've got two questions. I'm wondering if: It is possible to search for certain positions in a database (like Chessbase) and display all of them in a text file. To be able to assign a score to each ...
6
votes
0answers
194 views

Are there any dicylic graphing programs for chess? [closed]

Although chess is frequently thought of as a tree structure, it is not because positions can be arrived at through different move orders and moves can be repeated. Are their graphing programs/...
-2
votes
3answers
1k views

My chess AI makes the same repeated moves

I've built a chess game engine using Minimax and when I play AI against the AI, everything goes fine(for sometime) until both the AI players make the same set of moves again and again. Observe the ...
4
votes
2answers
154 views

Is the TSCP chess engine able to run on a 32 bit processor?

I'm a beginner learning about chess engines and would like to find a chess engine written in C (like TSCP) that doesn't use bitboards for board representation because I want to test the engine on a 32 ...
4
votes
3answers
1k views

Piping Stockfish input

I'm trying to write a Linux command line UCI interface for Stockfish. My program writes a bunch of commands to a text file and then tries to pipe them to Stockfish via the command line. My problem is, ...
3
votes
2answers
1k views

Is there an Android chess GUI library

I am looking for an open source chess gui library for Android that I can use in an app so that I don't need to take care of the GUI engine, but can focus on the logic behind it. I have searched for ...
6
votes
1answer
215 views

Mathematical formula to get how broad opening repertoire is

programmers and mathematicians! I'm looking for some opinions how to build meaningfull formula that represents broadness of opponent's repertoire. At the moment I do it like this: I filter all ...
14
votes
3answers
2k views

Alternative approaches to chess engine programming

As far as I understand, roughly speaking, chess engines work by: calculating all possible variations (game tree) up to some depth evaluating the final position based on some criteria (material, piece ...
3
votes
1answer
259 views

Best way to use UCI engine to play against itself

So far I used UCI only to make analysis of particular positions, sending FEN, showing multipv, analysing fixed depth/time, clearing hash for every next position. Now I would like to make the same ...
3
votes
1answer
163 views

Fathom syzygy browsing tool

I'm trying to make syzygy browsing tool fathom.exe work. If you have experience with this, please let me know. I tried million of combinations of tokens to format the position command and the program ...
3
votes
2answers
2k views

Implement a chess app for Android with Stockfish [closed]

I want to implement a chess app for Android with Stockfish. I downloaded the Stockfish binary source code, but I don't know how to use engine Please tell me how to use Stockfish engine for ...
11
votes
1answer
3k views

How to convert PGN moves to long algebraic notation (in python)?

I want to read a PGN file and then advance to a certain move number, and feed that to an UCI engine. Turns out engines work using long algebraic notation, and PGNs are in short algebraic. What is an ...
5
votes
1answer
1k views

Implementing Late Move Reduction (LMR) inside iterative deepening

Here I am trying to improve my engine, and the next feature on the list is LMR. I understood the general ideia, but since I don't want to introduce bugs and the CPW on the subject has no code, how do ...
4
votes
1answer
2k views

How to create your own opening book for your own chess engine?

I am currently working on a chess engine in Java. I am using the minimax algorithm with alpha-beta pruning to select the best move. However, it is inefficient to use the algorithm for selecting ...