Reply
 
LinkBack Thread Tools Display Modes
  #1   Report Post  
Old October 2nd 06, 01:45 PM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: Aug 2006
Posts: 58
Default short algebraic notation to long algebraic notation

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
  #2   Report Post  
Old October 2nd 06, 06:19 PM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: Jan 2006
Posts: 470
Default short algebraic notation to long algebraic notation


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   Report Post  
Old October 2nd 06, 10:34 PM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: Aug 2006
Posts: 58
Default short algebraic notation to long algebraic notation

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   Report Post  
Old October 2nd 06, 11:47 PM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: Jan 2006
Posts: 470
Default short algebraic notation to long algebraic notation


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   Report Post  
Old October 3rd 06, 11:59 AM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: Jul 2006
Posts: 625
Default short algebraic notation to long algebraic notation

* 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   Report Post  
Old October 3rd 06, 12:26 PM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: Apr 2005
Posts: 2,598
Default short algebraic notation to long algebraic notation

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   Report Post  
Old October 4th 06, 12:33 AM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: Jul 2006
Posts: 625
Default short algebraic notation to long algebraic notation

* 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   Report Post  
Old October 4th 06, 10:53 AM posted to rec.games.chess.computer
external usenet poster
 
First recorded activity by ChessBanter: Apr 2005
Posts: 2,598
Default short algebraic notation to long algebraic notation

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!
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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] [email protected] rec.games.chess.misc (Chess General) 0 February 19th 06 05:44 AM
rec.games.chess.misc FAQ [2/4] [email protected] rec.games.chess.misc (Chess General) 0 February 4th 06 05:25 AM
rec.games.chess.misc FAQ [2/4] [email protected] rec.games.chess.misc (Chess General) 0 December 4th 05 05:29 AM
rec.games.chess.misc FAQ [2/4] [email protected] rec.games.chess.misc (Chess General) 0 November 18th 05 05:36 AM


All times are GMT +1. The time now is 01:16 PM.

Powered by vBulletin® Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright 2004-2018 ChessBanter.
The comments are property of their posters.
 

About Us

"It's about Chess"

 

Copyright © 2017