Questions tagged [chess]

This tag is for concepts involving the game of Chess.

Filter by
Sorted by
Tagged with
6
votes
1answer
824 views

Recursive Breadth First Search for Knights Tour

This was written as an experiment in performance, based on another question here on CodeReview. Input into the algorithm is the number of squares on one edge of the chess board, the point of origin, ...
14
votes
3answers
3k views

N-Queens - Brute force - bit by bit

A discussion in The 2nd Monitor made me realize I had never 'solved' the N-Queens problem. Additionally, as I read up on it, I realized that the 64-squares in a chess board would work well if ...
18
votes
2answers
836 views

Finding legal knight moves in a chessboard in APL

I wrote a function that takes as input a vector with two integers between 1 and 8 representing a position in a chessboard and ...
8
votes
2answers
127 views

Game of Runes: revised version

I have created a game called Runes in C. It is similar to Chess, but has a bigger board and different pieces. I would like to know how I can improve the code, for example, with user interface ...
76
votes
6answers
213k views

Design a chess game using object-oriented principles

I would like to know if my approach is correct and how could it could be improved? Also, is there a way to get rid of the relation between the Piece and the ...
18
votes
4answers
73k views

Chess game in Python

I have programmed for 2 months, and I began writing a Chess game. I am a beginner programmer in Python, so please assess my code. ...
16
votes
2answers
16k views

Simple Chess Game, Part 1: The Board

I am currently creating a chess game, and have so far done the board. The board is pretty much a two-dimensional array, where Pieces are stored in their positions. ...
8
votes
3answers
318 views

Unicode Chess PvP with Move Validation

Main Purpose This script allows two players to play chess on a virtual chessboard printed on the screen by making use of the Unicode chess characters. Visual appearence ...
12
votes
3answers
3k views

Printing Command Line Unicode Chess Board

Let me preface this by detailing some of my design philosophy. The intent is to view the board from the perspective of the active player. Player moves are also factored into the design. When ...
2
votes
2answers
1k views

HackerRank - Queens Attack II - Java

The problem definition can already be found here. Given a chess board with dimensions n × n (where n is up to 100000) and the (r, c) positions of various obstacles, how many squares can a queen at a ...
13
votes
1answer
4k views

Hackerrank Queen's Attack II

Problem statement A queen is standing on an \$n\$x\$n\$ chessboard. The chessboard's rows are numbered from \$1\$ to \$n\$, going from bottom to top; its columns are numbered from \$1\$ to \$n\$, ...
10
votes
2answers
1k views

PHP Chess Version 2

For programming practice, I created a chess program in PHP (my most comfortable language). The program reads a FEN (a string with the location of all the pieces on the board) from the URL, generates ...
7
votes
3answers
384 views

Chess puzzle improvement

Is it possible to optimize this solution to the N-queens puzzle? ...
6
votes
4answers
264 views

Finding legal knight moves in a chessboard in APL (follow-up)

This question is a follow-up to this previous question of mine. Assuming I understood correctly what is outlined in this meta post. I wrote (and now, re-wrote) a function that takes as input a vector ...
5
votes
2answers
4k views

Finding all legal bishop moves

I am trying to create a two player Chess game. To do this I want to generate a list of legal moves. I am having trouble with the brevity of the code to generate the moves for the rooks and bishops. ...
4
votes
1answer
271 views

C++ generator function for a Chess game

Here is my code for a move generator function for a chess engine. It's currently working perfectly and returning fully legal moves. How can i improve it. I am looking to improve this generator ...
3
votes
1answer
136 views

Class modelling for a shogi notation reader

I have made GPL software in GitHub whose purpose is reading shogi notations (shogi is Japanese chess). I have been told that my software modelling is underdeveloped in this question and advised to ...
2
votes
1answer
3k views

Calculating all possible Knight turns (Chess)

I'm creating a console application that takes as input starting column and starting row, also the ending column and the ending row and it's going to output all the possible way's to get to that point ...
12
votes
2answers
661 views

N-Queens functional

I'm trying to get a better grip on the new functional possibilities of Java 8. As an example, I took this very elegant Haskell snippet: ...
10
votes
3answers
990 views

First Chess project

I'd made a project using pygame in python around 3 months ago. This was my first big project after I started learning how to program in college. Now I'd like to know just how good my programming ...
10
votes
1answer
140 views

Game of Runes: a similar concept to chess

I have created a game called 'runes' in C. It is similar to Chess, but has a bigger board and different pieces. I would like to know how I can improve the code, for example, by adding proper error ...
9
votes
2answers
14k views

Chess game in Windows Forms Part #1

I've recently created my own 2-player chess game, no AI... at least for now. I do plan to do that in the future, so one of my concerns is if the code is flexible enough to just use the same classes in ...
7
votes
4answers
8k views

Enumerating moves for a chess piece

I'm just at the beginning stages of making a simple chess engine. I have a function that when passed the x and y coordinates on a 2D list can enumerate all possible moves for a piece. It assumes there ...
6
votes
1answer
92 views

Design that avoids undesired dependencies in Kotlin for a chess engine

I'm trying to come up with a design for a chess engine in Kotlin that hides implementation details, and that ensures that such an implementation cannot accidentally become spaghetti. Client side ...
6
votes
3answers
2k views

Optimizing this Knight's Tour

My assignment in CS was to make a knight's tour application that could solve the problem from any starting position. I had just finished the code so excuse the lack of deeply descriptive comments. My ...
5
votes
2answers
3k views

Knight's Tour with Heuristics

When someone suggested that I solve Knight's Tour, I did so with heuristics and recursion. It takes a lot of time to solve even a 8x8 board: N-A1 N-C2 N-E1 ... N-E6 N-F4 Time used to solve: 5417011 ...
3
votes
1answer
2k views

Chess game in Windows Forms Part #2

(Part 1 here) I've recently created my own 2-player chess game, no AI... at least for now. I do plan to do that in the future, so one of my concerns is if the code is flexible enough to just use the ...
3
votes
1answer
337 views

Object-Oriented JavaScript Chess game

I am currently creating a chess game in JavaScript, some aspects are yet to be done such as the computer player and turns, but before I get into writing these features I would like to know how to ...
2
votes
1answer
1k views

Display all solutions for NQueens

In my previous NQueens Code Review question, I received feedback saying that I should write a program that would find all solutions. This revised program should be more general than before. ...
1
vote
0answers
378 views

PHP Chess Part 1 - ASCII Board & Import Position

I have been really into chess lately so I decided to program the game in PHP for practice. I want to get more comfortable with classes. Part 1 of the project is complete. I have a working ASCII board ...