Questions tagged [chess]
This tag is for the game of Chess and problems getting computers to play it.
1,235
questions
0
votes
0
answers
29
views
ChessAI: Why is recursion of a reference of a class somehow capped?
I have made a c++ class to represent a board and i have noticed that if i call a recursive function that has as an argument the reference to a board object, it stops after a while resulting in approx ...
1
vote
0
answers
32
views
Is there a way i could make this chessAI run faster?
I recently have been working on a chessAI in c++.
I have been able to implement the minimax algorithm, although i do find it very slow because the time it takes the computer to generate a move with a ...
0
votes
1
answer
77
views
Chess Engine Options Configuration
I modified the Goratschin Chess code so that it can run 8 chess engines at the same time, and it works;
however in the code the options management of each single chess engine is missing, so the system ...
3
votes
1
answer
43
views
What is the reasoning for the step size?
I am trying to visualise a chess board in python, I have found this code online in order to be able to do so and I am trying to understand how it works. I have a rough idea of how majority of it ...
0
votes
1
answer
14
views
Chess bitboard move generation
I am writing a chess engine, and I'm understanding how chess engines store game positions (in 64-bit bitboards) and how to generate moves from them. When you get your final bitboard of moves, how do ...
0
votes
1
answer
25
views
what kind of basic Ai algorithm is recommended for making the Jungle or ""Dou Shou Qi" game?
I'm making a Jungle or "Dou Shou Qi" game in JAVA on eclipse. its a board game similar in nature to chess and I'm having trouble with the AI. I thought about using minmax as it seems like ...
0
votes
0
answers
47
views
Transposition table look up for Fail-hard vs Fail-soft Alpha-beta, how do they differ?
I am new to chess-programming (and I actually make engine to some variant of draughts) and currently I'm trying to understand transposition tables.
I have seen many examples of transposition table ...
2
votes
1
answer
36
views
Minimax algorithm doesnt go for mate in chess
My goal is to code a somewhat OK chess engine, in the following position it's a mate in 2 which the engine should easily find with its depth of 4-5.
The first move the AI makes is Ra2 to trap the ...
-1
votes
0
answers
223
views
How to solve the Guarini problem BUT on a 3x4 board, and with six knights instead using DIVIDE AND CONQUER?
enter image description hereThere are six knights on a 3 × 4 chessboard: the three white knights are at the bottom row, and the three black knights are at the top row.
Design a divide and conquer ...
1
vote
1
answer
36
views
Javascript prompt vs custom prompt. (chessboardjs promotion)
backstory: In chessboardjs you load the board with callback functions for specific events. Chess mechanic that gives me problem is the promotion. I need to hold my callback, prompt a user for a piece ...
0
votes
1
answer
44
views
How to increase total positions considered for a chess engine
I'm writing a chess engine in Java and using bitboards to represent the board (12 64-bit numbers). The size of an instance of this class(its retained size) is 152Bytes according to IntelliJ debugger.
...
1
vote
2
answers
58
views
Checkmate function based on no library - reactjs
I have tried to figure out a function or algorithm with no use of library
so far I have a function for when there is a check, but can't wrap my head around the checkmate function...
I know I'm ...
1
vote
1
answer
29
views
Can react-chessground work with chessground@8 or above?
I created a react app where react-chessground works with chessground@7.16.13
And now I'm tryin to upgrade chessground to version 8.2.1, but there are 8 errors like:
ERROR in ./node_modules/react-...
0
votes
1
answer
46
views
Iterative deepening and move ordering
As I understand, when implementing iterative deepening the best move at one depth should be used for ordering moves at higher depths. I have one issue with this: say I got the move m as my best move ...
0
votes
1
answer
60
views
Chess Programming, Board Representation - Python
Saw this style of board representations and was wondering what kind of style this is? Bit-board or 0x88? Im newer to programming and even newer to Chess programming so this Board representation choice ...
-2
votes
1
answer
67
views
How can I use Stockfish in Python so that the evaluation is continuously updated like in chess.com, instead of computed for a given amount of time?
I am using the stockfish 3.23 package in python. To get the evaluation of the chess position, I use the following code:
self.stockfish = Stockfish(path="stockfish\\stockfish", depth=18, ...
-1
votes
1
answer
37
views
How to create a gamefield in qt with C++
Hello im new to qt (C++) and i try to programm the Game Dame. My Problem is now that i dont know how to make the gamefield (same as chess gamefield) where i can put the game figures on and show ...
1
vote
1
answer
23
views
Pycharm Window Not Displaying Correctly
I followed a Youtube tutorial for creating a Chess engine in Python code for code but it will not work in Pycharm? I can see that the correct chess board has been created but only when I close the pop-...
0
votes
2
answers
55
views
an html element become null
I am making a chess game, I wanna move the pieces using the drag and drop.
document.addEventListener("drop", function(event) {
if (event.target.className == "square") {
//remove the piece ...
0
votes
0
answers
46
views
How to move a selected item in qt with mouse click events
I am working on a chess gui and want to be able to move the selected piece from its original location to a selected destination tile. How can I select the piece I want to move and move it to a clicked ...
0
votes
1
answer
40
views
remove the child of an element (chess)
I am making a chess game, and I need your help to solve the following problem.
event.target.removeChild(event.target.firstChild);
dragged.parentNode.removeChild(dragged);
event.target.appendChild(...
0
votes
2
answers
52
views
Chess : implementing check in chess
I am building a chess game , I am now implementing a check.
here is my implementation:
export function check(position, color) {
let king;
position.forEach((row) => {
row.forEach((piece) ...
0
votes
1
answer
25
views
How can I display buttons without space between them on Android?
I want to make a chess app on Android and I'm trying to use Buttons to make a chessboard. The problem is that when I try to display the buttons there is space between them, and I don't know how to ...
0
votes
0
answers
31
views
Chess Game : Pure virtual method called terminate called without an active exception [duplicate]
So I tried "putting together" a chess game with a simple AI (Minimax algo) and it gave me the above error. I am kinda clueless as to how to proceed. Also please ignore the dummy print ...
0
votes
1
answer
55
views
How to improve the speed resetting a minimax chess board implementation?
I am programming a chess engine with minimax.
I use an array with 120 elements for the board. For every possible move, I have to create a copy of this array which is really slow without using bitboard....
-1
votes
1
answer
54
views
Implementing rook movies in Javascript chess game
I am trying to implement a chess game in javascript. I created a chessboard and a rook
let board1 = [
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0,...
0
votes
1
answer
56
views
Chess Dictionary Validator code keeps returning FALSE
I'm relatively new to coding, so any criticism is appreciated. I just finished chapter 5 of Automate the Boring Stuff and started the practice projects of the chapter. I've looked at other codes on ...
0
votes
0
answers
47
views
Does this function produce the correct number of knight full tours starting from each square on an 8 x 8 chessboard?
I have this JS function 'knightFullTours' that returns an object that represent each key as the starting square and value as the number of full tours a knight can make around the chess board. The ...
0
votes
0
answers
64
views
Return statement doesn't stop the method, C#, unity 2D
I'm working on a chess game and I'm trying to make a class that checks if a position is in check or not. Whithin that class I have a function that goes through squares whithin an array, to verify if ...
0
votes
2
answers
45
views
what is the fastest way to check 3repetition of chess position?
I am wirting chess Ai as a project. if positon repetes 3 times it is a draw I can create array with all previus position then get every updated position iterete over every previus one of them and see ...
-1
votes
1
answer
50
views
WPF Animation Position Parameter
I'm currently making a visual (WPF) representation for the chess engine I wrote.
For reference, I used this thread (Mark Feldman's answer) to create the chess board and the chess pieces.
Only ...
0
votes
0
answers
54
views
Detect insufficient material in chess game in JavaScript
I have created a Library for chess game in JavaScript.
In this library i decided that game should only be over when detect checkmate or insufficient material.
Game is working properly for checkmate ...
0
votes
1
answer
137
views
how to write the moves the knight can perform?
I wrote a program that examines threats of tools on a chessboard on other tools.
I want to write the movements that a knight can perform. I thought about checking the distance in Math abs in two ...
0
votes
0
answers
18
views
How to use Ascii Code and QList on a Java Chessboard
For my Java chess game, my teacher wants me to use an Ascii Code to give the tiles on the x-axis of the boards letters while the y-axis has numbers (like it is on a real board). I couldn´t find a way ...
0
votes
1
answer
103
views
How do I write a Multi threaded Alpha-Beta Search algorithm?
I'm trying to create a chess engine using an alpha beta minimax search algorithm, but the code is too slow. I've done all the optimisations I can think of, but it is still very slow in a single thread....
0
votes
0
answers
44
views
How do I get this painting event to work?
I'm trying to create a procedure that will draw all of the squares (and later pieces) for a chess board in a starting position, but I only want it to draw these images once so that I can update the ...
0
votes
2
answers
80
views
Stockfish does the same moves everytime for a given postition
Using stockfish for a chess program. It gives the same moves every time for any position. It even opens with the same moves.
I'm using the python-chess library for communicating with stockfish I'm not ...
1
vote
1
answer
33
views
How do i put the chess pieces in a python chessboard grid?
I am a begginer working on a college project and i need to make a chess game that works in the python console(can´t use the chess import), i just completed the board but now i have no idea how to put ...
0
votes
2
answers
94
views
perft-function of chess engine is giving self-contradictory output
I am currently developing a chess engine in C++, and I am in the process of debugging my move generator. For this purpose, I wrote a simple perft() function:
int32_t Engine::perft(GameState game_state,...
0
votes
0
answers
14
views
Vue-chessboard highlight move of "ai" not working
For a personal project i'm playing around with a chess library for vue, since it's not been updated for a while i'm not sure if someone can help me here, but we'll see i guess :)
In the documentation ...
-1
votes
1
answer
100
views
Why is my Minimax algorithm for chess taking so long to evaluate a move?
I am trying to create a simple chess AI in C# and have so far been successful to an extent using the minimax algorithm with alpha-beta pruning. However, with the code below it literally takes around 5 ...
1
vote
0
answers
60
views
Understanding how to do threaded alpha beta search
I am creating a chess engine and I want to add more of a speedup by adding threads.
I have tried looking at open source engines (stockfish, etc) and https://www.chessprogramming.org/Parallel_Search, ...
0
votes
0
answers
29
views
Minimax - Do you need to set maximising player to false when evaluating best move as black player?
I have implemented the minimax algorithm in python for a chess AI however I wanted to ask about how you would go about selecting the best moves for black.
Currently I have an Agent() class:
import ...
0
votes
0
answers
38
views
How to use transpositions?
I am making chess AI. But I do not understand transpositions table. Currently I am using fens to get to positions. But now I realized generating fens is about 1/2 time of total program time.
This is ...
0
votes
1
answer
71
views
Chess with PyGame: TypeError: unhashable type: 'list'
I'm trying to make a chess game, I'm watching a tutorial of 2021 using Python 3.9. I'm using 3.10 and maybe thats the reason thats not working. Anyways, let me show you the code:
import pygame as p
...
0
votes
0
answers
15
views
chess-image-generator library export bad quality png
Im using chess-image-generator library to draw chess pieces but the resulting quality is just too bad
var ChessImageGenerator = require("chess-image-generator");
var imageGenerator = new ...
0
votes
2
answers
34
views
Chess Engine Wrong Number of 4 Plie Board States [closed]
I'm writing a chess engine, and am trying to make it as fast as possible, so I'm using bitboards to represent each type of piece. I was printing out the number of different board states at each plie (...
0
votes
1
answer
33
views
Iterating String.split() working differently than I expected [duplicate]
I am writing a simple javascript code to parse, and verify a chess position written in Forsyth–Edwards Notation (FEN).
The default chess position in this notation is given by,
const defaultFEN = "...
0
votes
1
answer
38
views
Minimax returning illegal uci move - move generation doesn't update?
When I test my code with the position r1bqkbr1/pp2pppp/2n1p2n/2p5/3P4/7N/PPP2PPP/RNBQKB1R w KQq - 3 6 the code below outputs ValueError: illegal uci: 'd8d7' in r1bqkbr1/pp2pppp/2n1p2n/2p5/3P4/7N/...