Questions tagged [chess]

This tag is for chess related programming. You probably want to also include some more general tags such as [algorithms], [data-structures], [application-design] if you are asking about chess game programming.

This tag is for chess related programming. You probably want to also include some more general tags such as , , if you are asking about chess game programming.

24 questions
16
votes
3 answers

Is using Observer pattern a good idea while building a Chess Game?

I am trying to design a Chess Game using OOPs concepts that has a UI element to it. My idea is to show the number of squares / cells a piece can travel to when selected. Basically I want to show the paths / directions in which the it can travel /…
15
votes
10 answers

Best approach for writing a chess engine?

I'm a chess enthusiast and a programmer. I recently decided to start making a chess engine using my chess and programming knowledge. So here's my question: What language (I'm familiar with Java, C++ and Python) and methodology should I adapt while…
Adnan Zahid
  • 185
  • 1
  • 1
  • 11
11
votes
9 answers

Learning the rules of chess

A similar question asks whether a computer can learn to play optimally in chess by analyzing thousands of games. If a machine can look at the state of the board for a few games of chess (or a few games of checkers) in the beginning and after each…
Yktula
  • 213
  • 1
  • 5
10
votes
7 answers

N queens, X by Y board decision problem interview question

I was asked the following question in an interview today and I've been thinking about it ever since. I was not able to answer it and haven't been able to find a solution online. Given a chess board with dimensions X by Y and N queens, determine…
Interviewee
  • 111
  • 1
  • 4
9
votes
4 answers

Which paradigm to use for writing chess engine?

If you were going to write a chess game engine, what programming paradigm would you use (OOP, procedural, etc) and why whould you choose it ? By chess engine, I mean the portion of a program that evaluates the current board and decides the…
poke
  • 570
  • 4
  • 12
7
votes
5 answers

Chess: Efficiently deciding whether a check mate has been made

This question addresses building a Chess engine. I've done just that, and in my humble opinion quite elegantly. But I'm missing my ending conditions. Here are some pseudopython functions that I use. # Move from position old to new def move(old,…
Felix
  • 357
  • 2
  • 14
6
votes
3 answers

How to decompose / model a chessboard

As someone new to programming, I am building a chess web application in JavaScript, both for fun and to learn more about design patterns. I keep running into a wall, which is how to decompose the program. To start, I have picked a straightforward…
jds
  • 1,092
  • 2
  • 10
  • 19
5
votes
1 answer

What do I not understand about Alpha-Beta-Pruning in Chess?

I'm trying to write a chess engine, Min-Maxing works. Now I wanted to implement Alpha-Beta-Pruning, but despite reading about it and watching videos, I must have a severe misunderstanding somewhere. For Min-Maxing, I build the complete search tree,…
4
votes
3 answers

Is it acceptable to look at other people's projects for ideas?

When I start a new project, I tend to look at other people's source code who have implemented the same project. This gives me an idea on how the overall project is supposed to be created and the basic flow and the implementation logic of the…
Saad
  • 151
  • 2
4
votes
4 answers

Implementation of algorithm to generate chess positions

I am interested in developing a program that generates an endgame table-base for the chess. I have gone through the technical papers of the greats like Shannon and Ken Thompson. I have found that retrograde analysis is used for the generation. How…
TryinHard
  • 273
  • 1
  • 10
3
votes
5 answers

What programming paradigm do you think would work best for the AI aspect of a chess engine?

I wish to write a chess AI which simulates the way I think over the board, using C++. My focus is on writing the algorithms for choosing moves (decision making), not defining the board and pieces. To my knowledge, most chess programs written to date…
3
votes
2 answers

Implementation of chess endgame engine without Endgame Tablebases

I'm interested in creating an chess endgame solving engine. The endgames in chess are usually solved using the endgame table-bases generated by retrograde algorithm. I have found that Artificial Intelligence and Genetic Algorithms have been applied…
TryinHard
  • 273
  • 1
  • 10
3
votes
1 answer

Which programming guidelines for a chess network application?

I'd like to implement a simple chess peer to peer network application : one instance of the program may register friends player, and when one friend is "connected" (I mean both available by another program instance and registered as friend), I can…
loloof64
  • 137
  • 9
3
votes
3 answers

Language for Chess Position Evaluation (experimental)

My aim is to, via pattern analysis and statistics, (as well as piece mobility and position) build a chess position evaluation analyzer (rather than simply going brute force ply-searching). Id like to hear some thoughts a language that will be…
2
votes
3 answers

Efficient way to encode moves and container choice for chess moves for an engine

I am working on my chess engine in C++ and I went for bitboards to represent the board. It is basically a 64-bit number for which I use the bitset library. I feel the most crucial part in performance comes through the move generation. Earlier I…
user374476
1
2