Skip to main content

Questions tagged [chess]

This tag is for concepts involving the game of Chess.

Filter by
Sorted by
Tagged with
12 votes
3 answers
1k views

Chess game: board and moves

I'd like to preface this by saying firstly, my code is absolutely nowhere near complete, and secondly that I am essentially brand new to coding and this is my first real project. I like to be thrown ...
Liam V's user avatar
  • 121
6 votes
3 answers
668 views

Chess_Board Validator from Automate the Boring Stuff Ch 5

I recently started learning python and came up with this solution to the "Chess Dictionary Validator" exercise which is given in the end of chapter 5 in the book "Automate the Boring ...
Ro14514's user avatar
  • 63
6 votes
1 answer
55 views

Chessboard configuartions with no possible capture on the next move

THE TASK: Given an NxM "chess"board and Q,R,B,K where Q is the number of queens, R the number of rooks, B the number of bishops, and K the number of knights find out how many possible ...
Wow1345's user avatar
  • 121
1 vote
1 answer
137 views

C# chess engine performance

I am creating my own bitboard chess engine in C#. I am trying to optimize my make move, unmake move, and move generating functions to get a good fast base. My C# skills are average and got some tips ...
eligolf's user avatar
  • 119
11 votes
2 answers
2k views

Faster chess engine in python (with move ordering algorithm?)

I, an amateur coder, have been trying to code a chess engine with python as part of a larger research project. I started by following this tutorial (turns out creator of said tutorial has a github of ...
pjq42's user avatar
  • 211
2 votes
1 answer
149 views

C++ Chess Engine - Initialization of Magic Bitboard Attack Tables

I've just completed the generation of magic bitboard attack tables for bishops and rooks in my C++ chess engine. Main Questions The functions generateMagicNumbers()...
Hunter's user avatar
  • 259
2 votes
0 answers
200 views

Minimal Chess Web GUI with Flask

Being a big chess fan, I finally started developing my own chess tool, however I'm already quite dissatisfied with where it's going... folder structure: ...
Mantas Kandratavičius's user avatar
8 votes
2 answers
2k views

Checking if a chessboard presented as a dictionary, is a valid chessboard

Here's my solution to the Chess Dictionary Validator project in Automate the boring stuff by Al Sweigart. I'd love to know how I can improve this code so that it's more efficient. Thank you Function ...
Nova's user avatar
  • 113
6 votes
4 answers
229 views

2-Player Chess in WinForms V.2 (With Separation of Concerns)

Introduction After getting initial feedback on my first working version of this Chess WinForms game here, I have used the suggestions and comments from there to come up with this new version, trying ...
Shinglington's user avatar
4 votes
3 answers
381 views

Fully-functioning chess game in Python

This post is in succession to this question. I have implemented all functionalities like castling, en-passant, pawn promotion etc. 50 move rule and 3-move repetition is pending. I would like my code ...
RandomCoder59's user avatar
3 votes
2 answers
455 views

2-Player Chess in WinForms

Introduction I decided to program a two player Chess game in C# windows forms to help me to improve my programming skills and OOP skills. I have come to a working finished program (as far as I can ...
Shinglington's user avatar
7 votes
2 answers
2k views

Chess Game with GUI in C++ using SDL2

Introduction So, I recently completed a chess game with a GUI in Python, using Pygame. Upon research, I learned that Pygame is built on SDL, and since I wanted to practice C++ more, I decided to code ...
cold10's user avatar
  • 469
8 votes
2 answers
2k views

Text based chess game in Python

I have reached a significant milestone since the start of my chess game project. I have implemented all basic functionality. There is no castling, en passant and pawn promotion yet but I have ...
RandomCoder59's user avatar
7 votes
1 answer
255 views

Chess position representation with FEN parser

I'm developing a UCI chess engine and as part of my engine I need a position representation that stores the position of every piece on the board and all the information about the game, like castling ...
Aiya's user avatar
  • 108
2 votes
0 answers
264 views

Checkers move validator in Python 3

I have 3 classes to create a simple checkers move validator. The entry point is checkers.py and is mostly complete with a few things hard-coded. For example, the auto-generated board (if none is given)...
user22261's user avatar
4 votes
1 answer
1k views

Java 2 Player Object Oriented CLI Chess Game

I just finished implementing a Java 2 player CLI chess game, it involves player putting in commands (i.e "move e2 e4" to move or "attack d1 d5" to capture.). I am trying to follow ...
Yoh's user avatar
  • 61
2 votes
0 answers
243 views

Is MVC an overkill for a chess CLI game?

I am working on a CLI chess game that only involves 2 human players, I decided to make it follow the MVC architecture to ensure separation of concern and to make the possibility of a GUI/web ...
Yoh's user avatar
  • 61
2 votes
1 answer
470 views

Chess game setup: Initial board state

This app only creates a chess board set to the start-of-game state. It does nothing else. I'd appreciate feedback on the files that are relevant to this board setup (all shown below: board.cpp, pieces....
tarstevs's user avatar
3 votes
1 answer
471 views

Can two knights pieces attack one another from current positions?

I am working on my Python skills and would like some feedback on this problem I have tried to solve. I would like to return a boolean if two knights at their current position can attack each other ...
robotjeans's user avatar
2 votes
1 answer
227 views

Automate the Boring Stuff Chapter 5 Project - Chess Dictionary Validator

First post, very new to programming. This is my solution for the chapter 5 project of Automate the Boring Stuff and I wondered if I am making any mistakes and is there a way to make it more efficient ...
Javana's user avatar
  • 451
8 votes
1 answer
882 views

Making this python chess engine faster

I've implemented a chess engine using the python chess move generation library (which I assumed to be reasonably fast), and have implemented various optimisation techniques for search and move ...
ZED's user avatar
  • 91
1 vote
1 answer
298 views

C++ Chess Engine - (Magic)Bitboard-based move generation

I am currently writing a bitboard-based Chess Engine in C++, and I recently finished the move generation. I am using move-lookup-tables that get pre-calculated at application startup for sliding and ...
Tom Gebel's user avatar
  • 390
6 votes
1 answer
179 views

Chess game for two human players

I'm relatively new to programming, as in my second semester of college. To practice C, I started work on a chess game. I'm wondering if there are ways I could improve my code, make it look more ...
Kegan's user avatar
  • 63
2 votes
2 answers
159 views

Basic chess engine

I'm playing around with a chess engine that I wanted it to know all the rules such as pawn promotion, en-passant, and castling. Currently, I'm using a basic Negamax for the AI but I plan to improve at ...
jdt's user avatar
  • 2,362
7 votes
1 answer
404 views

Find all possible ways a rook can move to a diagonally opposite corner without going back to an already visited square

This question seems similar to this one: Find number of unique paths to reach opposite grid corner but is entirely not. For moving from upper-left corner to lower-right corner we are not restricted to ...
Prince Singh's user avatar
2 votes
0 answers
72 views

Chess quiz web site

I'm working on a personal project to build a website that quizzes users on chess opening theory moves. I know my code is not very object-oriented but I am working on refactoring it right now. I just ...
jawncopper's user avatar
1 vote
0 answers
112 views

First attempt at chess in Python #2

Almost a month ago I asked for some review of my first attempt at Chess in Python, with the main goal being to start learning inheritance in Python. It can be found here: First attempt at chess in ...
Brade's user avatar
  • 263
4 votes
3 answers
560 views

Clean up Knight Movement method in a chess project with duplicate code

I am writing a chess project using C++ and SDL. In this method I calculate all available moves a Knight can make and I want to refactor it. I basically move the knight Up/Down 2 squares and then Left/...
laegirl's user avatar
  • 43
15 votes
5 answers
3k views

First attempt at chess in Python

Since I have barely used inheritance in Python, I wanted to make something that would make use of it so I have attempted to create a game of chess, where each piece uses inheritance. I also did this ...
Brade's user avatar
  • 263
5 votes
1 answer
78 views

I'm writing a python chess UI+backend and I would like feedback on where there are issues before I continue to expand it

Firstly, the code relies on importing images, so I'll link to the repository as well as including the code here. If it's an issue that images need to be downloaded OR there is another solution please ...
Dpeen's user avatar
  • 53
1 vote
2 answers
253 views

Chess engine generates moves

I am currently writing a chess engine to improve my C++. I was able to improve my first results in terms of performance. (It is still really weak, but it does not lose a queen in one move) I ended up ...
Niclas's user avatar
  • 151
18 votes
2 answers
3k views

Chess engine for C++

Basic Description What is the program for? This is just a hobby project for me to improve at coding, not a serious one. What does the program do? It can take a chess position (not including variations ...
羅凋守 WitherClubtw's user avatar
3 votes
2 answers
411 views

Chess in Kotlin

This is an updated version of my first question: Chess game in Kotlin I wrote the following Chess logic in Kotlin and am looking for feedback to make the code cleaner and follow good software design ...
Florian Walther's user avatar
2 votes
1 answer
650 views

Chess game in Kotlin

I wrote the following Chess logic in Kotlin and am looking for feedback to make the code cleaner and follow good software design principles. I tried to adhere to object-oriented design. Some notes: • ...
Florian Walther's user avatar
15 votes
4 answers
4k views

Chess engine for chess without checks in C++

Project Description: Chess without checks: A chess variant where you can take the enemy king. This engine implementation is for chess without checks. Since checks don't exist, expect the code to not ...
Offtkp's user avatar
  • 371
2 votes
0 answers
74 views

minmax evaluation with alpha beta pruning [closed]

I'm making some small board game and wanted to code a very simple greed AI with this algorithm. It turns out it doesn't play the most greedy moves, it is simply not working. I'd appreciate any ...
rdar1999's user avatar
1 vote
1 answer
2k views

Simple console chess game C++

So I implemented a simple console-based, offline player vs. player chess game in C++17. I am aware that there are multiple chess-specific features I have not yet added, but the core gameplay works ...
Tom Gebel's user avatar
  • 390
1 vote
1 answer
241 views

Little chess game with python

I am pretty sure my code does not follow PEP 8 and would definitely want someone to point out my errors specifically. I am open any form of criticism or suggestions. ...
Joe's user avatar
  • 45
5 votes
3 answers
715 views

Chess Dictionary Validator (Python) (Automate The Boring Stuff)

This is an exercise in the Automate The Boring Stuff book. I am supposed to create a function that takes a dictionary argument that represents a chess board (ex: {'1h': 'bking', '6c': 'wqueen', '2g': ...
Nick 's user avatar
  • 99
3 votes
2 answers
2k views

Chess game object-oriented

This is an object-oriented Chess game. So far, I have implemented the pawn and board functionalities and I would love to get a ...
theProgrammer's user avatar
11 votes
2 answers
3k views

Parsing a Chess FEN

What is an FEN? Link to the Wikipedia page: Forsyth–Edwards Notation An FEN is a very simple way of representing a chess position in a single line string. It contains the following data Which piece ...
user avatar
6 votes
2 answers
1k views

Hackerrank's Queen's Attack II

https://www.hackerrank.com/challenges/queens-attack-2/problem A queen is standing on an nxn chessboard. The chessboard's rows are numbered from 1 to n, going from bottom to top; its columns are ...
Bork's user avatar
  • 63
5 votes
2 answers
365 views

Finding the number of moves a knight can perform while standing on a given square

This is a problem from CodeSignal which can be founded over here Here is an image on what we have to do: Code ...
NITIN AGARWAL's user avatar
4 votes
0 answers
606 views

Simple chess engine in Python

I have programmed a chess AI in python as a first project to learn both Python and the inner workings of a chess engine and wanted to have some input on syntax, code efficiency and any tips in general ...
Grim's user avatar
  • 41
17 votes
2 answers
6k views

C++ chess game engine using Minimax and alpha-beta pruning;

My chess game is over, everything has been finished, except for some special (like en passant)moves. The main part of the game is its engine which I have coded using the Minimax algorithm with alpha-...
user avatar
4 votes
1 answer
2k 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 ...
user avatar
0 votes
1 answer
149 views

Move generation n c++ for Knight [closed]

So I have been working on this Chess project and for that I need a move generator. I wish to know if I can improve my code for the move generation for the Knight. Here is my current code; Let me tell ...
user avatar
4 votes
1 answer
156 views

Transforming UCI-move into bitboard, chess

I want to transform a UCI-move into bitboard. for example a2a3 -> 32768, 8388608 I need to assign [7,6,...,0] to [a,b,...,h] so that for each letter i have the assigned number(n) to calculate 2^n ...
Jay Osayi's user avatar
5 votes
1 answer
478 views

Decode FEN string into separate variables for the 6 categories

FEN strings are compact representations of chess board positions which allows you to derive the necessary information to start playing a chess game from that position. This includes things like the ...
user avatar
7 votes
1 answer
1k views

Chess application with GUI and AI in Java

I've included the files that I felt were relevant (i.e I haven't included the individual pieces in the inheritance hierarchy). I'm particularly curious as to whether the system as a whole is ...
L292092's user avatar
  • 419