![]() |
| 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: algebraic, long, notation, short |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
When a chessengine or user enters a SAN move, do I need to know what moves he is capable at that moment of doing? Or is it enough to know what pieces are where on the board? Folkert |
| Ads |
|
#2
|
|||
|
|||
|
Folkert van Heusden wrote: Hi, When a chessengine or user enters a SAN move, do I need to know what moves he is capable at that moment of doing? Or is it enough to know what pieces are where on the board? Folkert You should be able to get the exact move given just the pieces on the board and a correctly formatted SAN move, that includes all proper disambiguation such as Ngf3 or Rhd1. jm |
|
#3
|
|||
|
|||
|
When a chessengine or user enters a SAN move, do I need to know what
moves he is capable at that moment of doing? Or is it enough to know what pieces are where on the board? You should be able to get the exact move given just the pieces on the board and a correctly formatted SAN move, that includes all proper disambiguation such as Ngf3 or Rhd1. Ah ok, really glad to hear that. Thanks! |
|
#4
|
|||
|
|||
|
Folkert van Heusden wrote: When a chessengine or user enters a SAN move, do I need to know what moves he is capable at that moment of doing? Or is it enough to know what pieces are where on the board? You should be able to get the exact move given just the pieces on the board and a correctly formatted SAN move, that includes all proper disambiguation such as Ngf3 or Rhd1. Ah ok, really glad to hear that. Thanks! Note that this implies that the SAN move that you are trying to make is legal! You may need to do some checking just to make sure that a move doesn't expose the King to check, or that castling or en passant are truly legal. So, to be more precise, I should have said "given a full FEN of the position and a SAN move, you should be able to determine the exact move". jm |
|
#5
|
|||
|
|||
|
* Folkert van Heusden (14:45) schrieb:
When a chessengine or user enters a SAN move, do I need to know what moves he is capable at that moment of doing? Or is it enough to know what pieces are where on the board? With SAN you always know: - the type of the piece that moves - the square the piece moves to - if it captures another piece or not - if it is a promotion and what kind When you have more than one piece of the indicated type, SAN almost never tells you which of the pieces is to move. I found it easiest to generate a list of legal moves and check for the one that satisfys all the constraints of the SAN string. But of course you can walk through the pieces of the indicated type and test if they cann legally move to the target square. But that needs almost the same code as the move generator. The best way might be to just generate legal moves that satisfy the contraints. With bitboards that would look like: "exd5" for white generate_legal (type = WHITE_CAPTURING_PAWN, from = pawns & white & BITBOARD_FILE(E), to = black & BITBOARD_SQUARE(D5)) "Ng2" for black generate_legal (type = KNIGHT, from = knights & black to = ~white & BITBOARD_SQUARE(G2)) "Q8xg2" for black generate_legal (type = QUEEN from = queens & black & BITBOARD_RANK(8), to = white & BITBOARD_SQUARE(G2)) If the SAN is correct this will always produce exactly one move. mfg, simon .... l |
|
#6
|
|||
|
|||
|
Simon Krahnke wrote:
With SAN you always know: - the type of the piece that moves - the square the piece moves to - if it captures another piece or not - if it is a promotion and what kind When you have more than one piece of the indicated type, SAN almost never tells you which of the pieces is to move. I assume you mean that SAN almost never tells you explicitly which of the pieces is to move. Obviously, SAN always tells you implicitly: otherwise, it would be ambiguous. Dave. -- David Richerby Lead Bulb (TM): it's like a light bulb www.chiark.greenend.org.uk/~davidr/ that weighs a ton! |
|
#7
|
|||
|
|||
|
* David Richerby (13:26) schrieb:
Simon Krahnke wrote: With SAN you always know: - the type of the piece that moves - the square the piece moves to - if it captures another piece or not - if it is a promotion and what kind When you have more than one piece of the indicated type, SAN almost never tells you which of the pieces is to move. I assume you mean that SAN almost never tells you explicitly which of the pieces is to move. Obviously, SAN always tells you implicitly: otherwise, it would be ambiguous. Well, the SAN string *is* ambigous for the question from which square the piece moves. You need to look at the board to disambiguate. The only exceptions are like "a7" = a6, "dxc1=N" = d2 or "Ra8a5" = a8. When all you have is "e4" you don't know if the pawn is black or white or whether it is currently standing on e2, e3 or e5. I tried to list what the SAN string alone tells in every case. I should have written that. mfg, simon .... l |
|
#8
|
|||
|
|||
|
Simon Krahnke wrote:
David Richerby (13:26) schrieb: Simon Krahnke wrote: When you have more than one piece of the indicated type, SAN almost never tells you which of the pieces is to move. I assume you mean that SAN almost never tells you explicitly which of the pieces is to move. Obviously, SAN always tells you implicitly: otherwise, it would be ambiguous. Well, the SAN string *is* ambigous for the question from which square the piece moves. You need to look at the board to disambiguate. Oh, OK. That's not how I read your post but it's obvious now that we're in agreement. Dave. -- David Richerby Perforated Bulb (TM): it's like a www.chiark.greenend.org.uk/~davidr/ light bulb but it's full of holes! |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| parsing short algebraic notation | Folkert van Heusden | rec.games.chess.computer (Computer Chess) | 4 | October 3rd 06 11:51 AM |
| rec.games.chess.misc FAQ [2/4] | pribut@yahoo.com | rec.games.chess.misc (Chess General) | 0 | February 19th 06 05:44 AM |
| rec.games.chess.misc FAQ [2/4] | pribut@yahoo.com | rec.games.chess.misc (Chess General) | 0 | February 4th 06 05:25 AM |
| rec.games.chess.misc FAQ [2/4] | pribut@yahoo.com | rec.games.chess.misc (Chess General) | 0 | December 4th 05 05:29 AM |
| rec.games.chess.misc FAQ [2/4] | pribut@yahoo.com | rec.games.chess.misc (Chess General) | 0 | November 18th 05 05:36 AM |