chess

Chess programming (no AI) - moves validation

岁酱吖の 提交于 2019-12-06 00:44:06
问题 I'm trying to program my own chess engine (no AI). I know there is Chess Game Starter Kit and I watched it for start inspiration. But what I didn't catch is where are validated moves (here is moves validation) for my non-king pieces preventing to get myself to check? Imagine situation: A5 - opponents rook A4 - my bishop A3 - my king I can't move my bishop now since I would get to check. Or how would you suggest to check this situation? Thank you 回答1: For a given board position, most chess

Displaying unicode chess pieces in Windows-console

烈酒焚心 提交于 2019-12-05 15:24:31
I've been developing a console Chess-game in C++ (using MVS2010) and I seem to have faced a problem I cannot solve on my own. The matter is that I need to have the following chess pieces displayed in console: http://en.wikipedia.org/wiki/Chess_symbols_in_Unicode I certainly went through a great amount of forums, articles and documentations and still does not have the task done. I understand that some characters (in particular, the ones I need) cannot be displayed using fonts provided by Windows-console. But console supports only several fonts: consolas and lucida console. The last one is good

Communicating with XBoard (chess engine) (C++/C)

若如初见. 提交于 2019-12-05 12:03:11
I was just toying around with making a basic chess engine. I was able to get a lot of advice from http://web.archive.org/web/20070704121716/http://www.brucemo.com/compchess/programming/alphabeta.htm , but the real site is down and not all the pages are archived. (Anyone know where to find a full version of Bruce's site?) But now to the real question: how do I communicate with XBoard? I understand it is via stdin and stdout, but I've been having problems in code. Basically, to get started, I just want to receive input from XBoard and print it to the console/screen Give a move of hard-coded

Chess piece hierarchy design: inheritance vs type fields

谁说我不能喝 提交于 2019-12-04 20:53:07
问题 I have a base class for pieces class piece; and an array containing derived objects piece* board[8][8]; Advantage, clean design through virtual functions. Disadvantage, if I have to find a piece in the board or compare a piece I have to revert to dynamic casting (or typeid). It’s ugly and could be a performance hog when making millions of requests. In the other hand, if I make an array of a single piece class, that has a type field for identifying pieces, I don’t have this problem (and it

How can I effectively encode/decode a compressed position description?

和自甴很熟 提交于 2019-12-04 11:47:24
I am writing a tablebase for a Japanese chess variant. To index the table base, I encode each chess position as an integer. In one of the encoding steps, I encode where the pieces are on the board. Since the actual method is a bit complicated, let me explain the problem in a simplified manner. The Encoding In the endgame tablebase, I have (let's say) six distinct chess pieces that I want to distribute over a board with 9 squares. I can naïvely represent their positions by a six-tuple ( a , b , c , d , e , f  ) where each of the variables a to f is a number in the range 0 to 8 inclusive

Preventing cheating in online chess games? [closed]

会有一股神秘感。 提交于 2019-12-04 08:55:15
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 8 months ago . In many online chess lobbies, I've seen instances of 'engining', where a cheater would open a chess program at the same time as the main game window. He would then set it up so that the opponent's moves are relayed to the computer, then which he would copy the computer's moves,

How hard is it to implement a chess engine? [closed]

随声附和 提交于 2019-12-04 07:21:16
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . I'm wondering how hard it would be to implement a chess engine . Are there already open-source implementations? It seems that you'd need a scoring function for a given board constellation, and a very fast way of exploring several likely future board constellations. Exploring

Chess move validation library [closed]

允我心安 提交于 2019-12-04 06:16:11
Is there any library which can be used to validate chess moves and simulate games in .NET? It would be great if the library can understand moves in Algebraic notation and also provide simple API for making moves. For example, game.Move("E2","E4") etc. In the second case, the library should be able to generate Algebraic notation for the moves. I don't want it to make moves or to play chess etc, just a library for game validation and game simulation. Any links? Adam Berent Have a look at the C# Chess Game Starter Kit . It is a C# Open Source Application that does exactly what you requested and

Rook movement function not finding interruptions

不问归期 提交于 2019-12-04 06:10:34
问题 I am trying to write a function that checks if the black king is in check by the white rook. The problem occurs when I try to search if there are any pieces in between the rook and the king. void rook_white(piece A[]) // does WR check BK { cout << "Found White Rook "; int k_x; // BK'S x coordinate int k_y; // BK's y coordinate bool check = false; for(int x=0; x<8; x++) { for(int y=0; y<8; y++) { if(A[t_i].field[m_x-x][m_y] == 'k') // Moving Left { k_x=m_x; k_y=m_y; goto al_1; } } } for(int x

Programming a chess AI

我怕爱的太早我们不能终老 提交于 2019-12-04 00:25:25
I'm looking to try and write a chess AI. Is there something i can use on the .NET framework (or maybe even a chess program scripted in Lua) that will let me write and test a chess AI without worrying about actually makign a chess game? Not sure about what you are trying to do. If you are looking for a ready-to-use chess GUI, you can use WinBoard . It is completely decoupled from the underlying chess engine(s), thanks to an established communication protocol. Your chess engine thus becomes a console app exchanging commands with the GUI. A more modern alternative following the same concept is