Questions tagged [chess]

This tag is for the game of Chess and problems getting computers to play it. Use this tag for questions about algorithms and other programming problems specifically related to chess playing. Do not use this tag for general programming questions just because your program plays chess.

Chess is a strategic, symmetrical board game with the goal of placing the opponent's leader piece, known as the King, under attack from one of your pieces such that they are unable to avoid being captured by the next turn. This is known as being placed in "checkmate".

Computer chess engines have become increasingly complex since the early 2000s when they became able to beat the world's leading chess grand masters. Some of the leading chess engines as of 2022 are the opensource Stockfish and Google's AlphaGo.

One might presume that due to the deterministic nature of chess it might be possible to "solve" the game such that a victory or draw would be guaranteed. However, due to the enormous number of possible variations in Chess it remains unsolved even by the most advanced chess engines.

Some current popular evaluation methods used are the Monte Carlo tree search and Minimax search.

External links

1386 questions
16
votes
2 answers

How does one integrate stockfish into an Android App?

I'm trying to work out how to integrate stockfish (or any UCI compatible engine) into my Android application. I've downloaded the stockfish Android zip from here: Download Stockfish Engine. Under the Android directory of the zip there are two…
yarrichar
  • 423
  • 5
  • 17
15
votes
8 answers

What is the state of the art in computer chess tree searching?

I'm not interested in tiny optimizations giving few percents of the speed. I'm interested in the most important heuristics for alpha-beta search. And most important components for evaluation function. I'm particularly interested in algorithms that…
Łukasz Lew
  • 48,526
  • 41
  • 139
  • 208
15
votes
1 answer

Computing a move score in a Minimax Tree of a certain depth

I've implemented a Chess game in C, with the following structs: move - which represents a move from (a,b) to (c,d) on a char board[8][8] (Chess board) moves - which is a linked list of moves with head and tail. Variables: playing_color is 'W' or…
Evgeny
  • 415
  • 4
  • 17
15
votes
4 answers

Currently known best algorithm(s) for computer chess?

I just wanted to learn name of algorithms.. thanks
anarhikos
  • 175
  • 1
  • 1
  • 3
14
votes
4 answers

Programming a chess AI

I'm looking to try and write a chess AI. Is there something i can use on the .NET framework (or maybe even a chess program scripted in Lua) that will let me write and test a chess AI without worrying about actually makign a chess game?
RCIX
  • 38,647
  • 50
  • 150
  • 207
13
votes
10 answers

What RESTful API would you use for a turn-based game server?

How would you model a turn-based game server as a RESTful API? For example, a chess server, where you could play a game of chess against another client of the same API. You would need some way of requesting and negotiating a game with the other…
Ross
  • 9,652
  • 8
  • 35
  • 35
13
votes
9 answers

efficient storage of a chess position

I've read tons of web hits related to this issue, and I still haven't come across any definitive answer. What I'd like to do is to make a database of chess positions, capable of identifying transpositions (generally which pieces are on which…
Adrian
  • 744
  • 7
  • 17
13
votes
1 answer

Create a Chess board with JPanel

I have a simple Chess board in a JPanel with GridLayout(8,8) as layout manager. I am trying to add panels for the fields' column name and row number. Right now I've created another panel with BorderLayout as layout manager, and in this panel I add…
Jamgreen
  • 10,329
  • 29
  • 113
  • 224
13
votes
3 answers

Sliding move generation using magic bitboard

This is a question regarding the big picture of how to validate a sliding piece move in chess using magic bitboards. Just to clarify, I am not asking how magic bitboards work internally. Now, some more details about the question. I'm writing chess…
bytefire
  • 4,156
  • 2
  • 27
  • 36
13
votes
3 answers

How to Communicate with a Chess engine in Python?

On Windows 7 I can communicate with a chess engine via command line. Small example session with Stockfish on Win 7: C:\run\Stockfish>stockfish-x64.exe Stockfish 2.2.2 JA SSE42 by Tord Romstad, Marco Costalba and Joona…
Nils Lindemann
  • 1,146
  • 1
  • 16
  • 26
12
votes
3 answers

Detecting checks more efficiently (Chess)

I'm currently working on a chess engine, which is working so far but is taking forever to generate moves. The check detection takes by far the longest since many moves have to be generated. I got stuck after trying many things and can't really…
Honn
  • 737
  • 2
  • 18
12
votes
4 answers

Converting a PGN to a list of FEN strings in nodejs (chess notations)

I'm building a chess-related application using nodejs. I've been trying to use chess.js as much as I can but I think I've hit a roadblock in terms of functionality. Before extending that functionality, I wanted to make sure that there wasn't another…
user623990
12
votes
11 answers

Statistical approach to chess?

Reading about how Google solves the translation problem got me thinking. Would it be possible to build a strong chess engine by analysing several million games and determining the best possible move based largely (completely?) on statistics? There…
Chinmay Kanchi
  • 62,729
  • 22
  • 87
  • 114
11
votes
6 answers

Anyone know of a good .Net Chess Engine

I'm looking for a decent .Net chess engine. If there is a good chess existing one, any recommendation as to a good candidate to port to .Net?
Greg Dean
  • 29,221
  • 14
  • 67
  • 78
11
votes
2 answers

Chess: Bug in Alpha-Beta

I am implementing a chess engine, and I have written a fairly complex alpha-beta search routine with quiescence search and transposition tables. However, I am observing a strange bug. The evaluation function is using piece-square tables, like this…
1
2
3
92 93