![]() |
| If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|||||||
| Tags: analysis, checkmate |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
i am writing an graphical user interface for chess using OpenGl. I
need to also validate the moves of the players as the interface should be usable across a network. The problem arises when i try to identify the cases when a checkmate or a stalemate position. i have no better idea than computing all possible next moves and finding that they are invalid. This is a too big a task to perform after every move. on the other hand giving the user an option to claim checkmate or draw seems too naive. Is there a better algorithm to find this out. thanks for anything from pointers to code ( in C or C++) |
| Ads |
|
#2
|
|||
|
|||
|
abi wrote:
i am writing an graphical user interface for chess using OpenGl. I need to also validate the moves of the players as the interface should be usable across a network. The problem arises when i try to identify the cases when a checkmate or a stalemate position. i have no better idea than computing all possible next moves and finding that they are invalid. Yes, there is probably no other efficient and easy to implement way. This is a too big a task to perform after every move. Why? It should take only some microseconds for each move, probably much less than needed to redraw the board, or whatever else you do in you GUI. But it needs almost a chess-engine, to verify - sure. You'll need a move- generator, an "Incheck" routine, and a one ply search. But it won't take long. Regards, Dieter |
| Thread Tools | |
| Display Modes | |
|
|