FAQ Database Discussion Community


Chess AI with alpha beta algorithm

c++,algorithm,artificial-intelligence,chess,alpha-beta-pruning
I have implemented the alpha beta algorithm for my chess game, however it takes a lot of time (minutes for 4-ply) to finally make a rather stupid move. I've been trying to find the mistake (I assume I made one) for 2 days now, I would very much appreciate some...

IL2CPP Compiler Runtime Errors for Unity3D iOS 64-bit

c#,ios,unity3d,mono,chess
I have a Unity3D Mobile Chess app I am porting from 32-bit to 64-bit with Unity 3D 4.6.5f1. It's using OpenGLS2.0, .NET 2.0 libraries, and Universal binaries are being generated. I am getting a runtime error which in the debugger says the following: NullReferenceException: A null value was found where...

Get enemy's possible moves in chess to a 2D array - Python

python,arrays,chess
I have three arrays, chess = [["c","d","e","f","g","e","d","c"], ["b","b","b","b","b","b","b","b"], ["a","a","a","a","a","a","a","a"], ["a","a","a","a","a","a","a","a"], ["a","a","a","a","a","a","a","a"], ["a","a","a","a","a","a","a","a"], ["h","h","h","h","h","h","h","h"], ["i","j","k","l","m","k","j","i"]] that stores the positions of the pieces, ('a' is empty, 'b' is a black pawn etc.) and two other 8x8 arrays filled with False named whiteMoves and blackMoves. What I want is a function def getEnemyMoves():...

How to work with MouseListener. Don't work GUI [closed]

java,swing,user-interface,chess
I am trying to write simple chess application based on this tutorial: https://proghammer.wordpress.com/2010/08/10/chess01-dragging-game-pieces/ I use this code with some changes, and it doesn't work. I am really new in Java GUI programming, can someone tell me what I do wrong. UPDATE: I am trying to correct my mistakes, when I...

Chess Engine - Represent bitboard in 32bit Nasm

assembly,32bit-64bit,chess
I'm trying to write a chess engine in 32bit nasm. I read up on bit boards and I want to represent the board using bit boards, however the fact i'm working with 32bit registers is an inconvenience. What I did is divide each bit board into 32bit sections. But would...

What is this code doing?

c,bit-manipulation,chess
const int BitTable[64] = { 63, 30, 3, 32, 25, 41, 22, 33, 15, 50, 42, 13, 11, 53, 19, 34, 61, 29, 2, 51, 21, 43, 45, 10, 18, 47, 1, 54, 9, 57, 0, 35, 62, 31, 40, 4, 49, 5, 52, 26, 60, 6, 23, 44, 46,...

Reference anonymous inner class from other class file

java,jni,chess
Hi guys is there anyway that I can reference or use this anonymous inner class in other classes? private DgtebdllLib.CallbackFunctionCharPtr getScan = new DgtebdllLib.CallbackFunctionCharPtr() The full code is below and I found this Java code here. This is an example for interfacing with DGT chessboard DLL using Java. What I...

Programming Chess Rook Movement

chess,rook
I am trying to create a boardgame where all the pieces are able to move the same as a rook in chess. (i.e. Horizontally or vertically as many spaces as they wish) My board is a simple 2d integer array, with values of 0,1,2 depending on whether the space is...

Getting Stuck On the Algorithm for q bishops on an n*n chessboard

c++,algorithm,search,chess,n-queens
I'm using C++, but my question is more about algorithms than implementation. The problem is the following: Write a program that inputs two integers n and k, where n>=k. Your program should calculate the number of different ways that k bishops could be placed on an nXn chessboard. My basic...

Would this be a suitable MVC chess (GUI) model?

java,user-interface,model-view-controller,chess
I'm making a Java chess game as a uni project, and I'm basically getting the move from a player using a GUI. My game has several classes, but the main classes are the Pieces, HumanPlayer and GraphicalDisplay classes. What I'm basically doing is, when the HumanPlayer wants to make a...

Making a chess game in Java, I want to move the pieces

java,swing,jbutton,imageicon,chess
So I have my images stored as ImageIcon's on JButtons. I want the user to click on the JButton of the piece they want to use and then click on another JButton to move it there, how would I do this? I've tried using an actionListener to get the ImageIcon...

C++ possible chess knight movement recursive

c++,function,recursion,movement,chess
My code so far: #include <iostream> using namespace std; int a,b,k,l; // a and b - knight cordinates, k,l-cordinates of possible move bool isTrue(int m,int n) { if (m==a-2 && n==b-1) {k=m;l=n;return 1;} else if (m==a-2 && n==b+1) {k=m;l=n;return 1;} else if (m==a-1 && n==b-2) {k=m;l=n;return 1;} else if (m==a-1...

Chess game gives invalid moves

java,debugging,chess
I'm writing a chess game, but I keep running into a bug. When I ask for valid moves, my program returns some spots that shouldn't be valid. This is my current code public enum PieceType { PAWN('p', (piece, pieceOnEndTile, board, move) -> { PieceTeam team = piece.getTeam(); int dx =...

Chess alpha beta returning wrong move for the board

java,chess,minimax
I am trying to implement a chess game with alpha beta pruning. The following is almost working, but it returns wrong moves. For example, the following can occur. White (user) to move, white king position - a1 / Black (computer), black king position - h1 White moves its king from...

Alpha-beta prunning with transposition table, iterative deepening

algorithm,artificial-intelligence,chess,alpha-beta-pruning,minmax
I'm trying to implement alpha-beta min-max prunning enhanced with transposition tables. I use this pseudocode as reference: http://people.csail.mit.edu/plaat/mtdf.html#abmem function AlphaBetaWithMemory(n : node_type; alpha , beta , d : integer) : integer; if retrieve(n) == OK then /* Transposition table lookup */ if n.lowerbound >= beta then return n.lowerbound; if n.upperbound...

How to beat best chess engines? [closed]

artificial-intelligence,chess
i am currently learning and practising chess using stockfish engine. When i set the difficulty to maximum, it is impossible to win against these chess engines. Has the machines evolved that far to be intelligent? I have 2 quick questions for the chess fans here: What are the ways to...

Is it OK to have an empty method?

java,oop,subclass,hierarchy,chess
Is it OK to have an empty method and have it overridden in its subclass(es)? This is how it would look like in my code. public class Rook() { public void voidCastleRight() { } } public class ShortRook() extends Rook { @Override public void voidCastleRight() { getPlayer().setkSC(false); //void King Side...