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.

Filter by
Sorted by
Tagged with
-3 votes
2 answers
112 views

What design pattern / class / interface should I use for encapsulating a program? [closed]

I am building a chess - related application, and I want to use a pre-compiled program called Stockfish as my chess engine. I am wondering what is the best practice to encapsulate the usage of the ...
Aviv Aviv's user avatar
  • 117
3 votes
3 answers
726 views

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 ...
user avatar
2 votes
2 answers
760 views

How to design different moves of different pieces of a Chess game using OOP principles?

I am trying to design a Chess game where each piece of the game inherits from an abstract Piece class. The piece just does a few things: It tells which color it is (White / Black) It tells what type ...
Auro's user avatar
  • 291
16 votes
3 answers
6k views

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 ...
Auro's user avatar
  • 291
5 votes
1 answer
929 views

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. ...
Robert Tausig's user avatar
7 votes
5 answers
3k views

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. ...
Felix's user avatar
  • 377
0 votes
1 answer
349 views

Modification in knight's tour problem

So i have a modified knight's tour problem. The problem is the following , is there an algorithm that can give you the route(if possible the shortest) from (1,1) to (n,m) in a chessboard of the knight ...
user avatar
4 votes
3 answers
262 views

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

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 ...
Saad's user avatar
  • 151
3 votes
5 answers
894 views

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 ...
Seeking_Truth's user avatar
0 votes
3 answers
2k views

C++ Chess board design and smart pointers [closed]

I wrote a Chess engine in Java and I am porting it over to C++. I am new to C++. The idea: I have a Board object which holds a 2-dimensionnal array of Piece objects. Queen, Rook, Bishop, etc are ...
Romain's user avatar
  • 117
6 votes
3 answers
765 views

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 ...
jds's user avatar
  • 1,102
1 vote
1 answer
188 views

Implementation/Representation of Symmetries in Chessboards

In a 8X8 chessboard, I was wondering how to implement the symmetry of the board. A lot of positions are just mirrors or rotations of one another (with no pawns or castling capabilities left the ...
TryinHard's user avatar
  • 273
3 votes
2 answers
951 views

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 ...
TryinHard's user avatar
  • 273
4 votes
4 answers
1k views

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 ...
TryinHard's user avatar
  • 273
2 votes
3 answers
1k views

How does a chess engine decide what move to make?

I'm writing a simple chess engine in LISP. I actually know how the engine decide the move, it evaluates and reads some opening books. But that's not what i mean. This is my design. 57 58 59 60 61 62 ...
Lynob's user avatar
  • 129
1 vote
5 answers
5k views

What would be the fastest way of storing or calculating legal move sets for chess pieces?

For example if a move is attempted I could just loop through a list of legal moves and compare the x,y but I have to write logic to calculate those at least every time the piece is moved. Or, I can ...
MetaGuru's user avatar
  • 2,663
3 votes
1 answer
884 views

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 ...
loloof64's user avatar
  • 137
1 vote
3 answers
370 views

About classes and their valid states

I get stuck each time I need to write a constructor for any class I design. The reason is that I am not sure what should go into a constructor and what should not. On googling for this, I got the ...
TheSilverBullet's user avatar
3 votes
3 answers
568 views

Language for Chess Position Evaluation (experimental) [closed]

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 ...
bmf's user avatar
  • 59
15 votes
10 answers
16k views

Best approach for writing a chess engine? [closed]

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++ ...
Adnan Zahid's user avatar
10 votes
7 answers
6k views

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 ...
Interviewee's user avatar
1 vote
1 answer
953 views

Writing a game engine using javascript

..by this I mean a logic handler for a chess game. Basically validating a move and checking if somebody has won. Now ignore the complexity of the game(if you can..) I'd like some sort of psuedo code ...
Julio's user avatar
  • 111
11 votes
9 answers
1k views

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 ...
Yktula's user avatar
  • 213
8 votes
4 answers
3k views

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 ...
poke's user avatar
  • 560