A Chess forum. ChessBanter

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.

Go Back   Home » ChessBanter forum » Chess Newsgroups » rec.games.chess.computer (Computer Chess)
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Tags: , , ,

short algebraic notation to long algebraic notation



 
 
Thread Tools Display Modes
  #1  
Old October 2nd 06, 01:45 PM posted to rec.games.chess.computer
Folkert van Heusden
external usenet poster
 
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
Ads
  #2  
Old October 2nd 06, 06:19 PM posted to rec.games.chess.computer
JVMerlino@aol.com
external usenet poster
 
Posts: 181
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  
Old October 2nd 06, 10:34 PM posted to rec.games.chess.computer
Folkert van Heusden
external usenet poster
 
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  
Old October 2nd 06, 11:47 PM posted to rec.games.chess.computer
JVMerlino@aol.com
external usenet poster
 
Posts: 181
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  
Old October 3rd 06, 11:59 AM posted to rec.games.chess.computer
Simon Krahnke
external usenet poster
 
Posts: 49
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  
Old October 3rd 06, 12:26 PM posted to rec.games.chess.computer
David Richerby
external usenet poster
 
Posts: 2,498
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  
Old October 4th 06, 12:33 AM posted to rec.games.chess.computer
Simon Krahnke
external usenet poster
 
Posts: 49
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  
Old October 4th 06, 10:53 AM posted to rec.games.chess.computer
David Richerby
external usenet poster
 
Posts: 2,498
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!
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 08:18 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.Content Relevant URLs by vBSEO 2.4.0
Copyright ©2004-2008 ChessBanter, part of the NewsgroupBanter project.
The comments are property of their posters.
Mortgage - Problem Mortgage - Loans - Loans - Credit Cards