SAN => coordinates?

Code, algorithms, languages, construction...
Post Reply
kevincrawfordknight
Posts: 2
Joined: Mon Apr 09, 2018 5:54 pm

SAN => coordinates?

Post by kevincrawfordknight » Mon Apr 09, 2018 5:58 pm

Greetings,

I'm using gnuchess to decide which move a robot should make, and using that output to control a robot arm (to execute the move on a real board).

However, gnuchess outputs SAN (Standard Algebraic Notation), such as "Nf3". To control the robot arm, it would be much more helpful to have a coordinate-based notation, such as "g1-f3".

My question is:

1) Is there a way to get gnuchess to output coordinate-based notation? I know it can accept such notation as input (human-supplied move).

-or-

2) Is there existing software (or detailed algorithm) that takes
(a) a SAN move
(b) a .eps board
and produces:
(c) a coordinate-based move?

Thanks!
Kevin



PS. I use Linux, and here is how I get gnuchess to make its (SAN) move recommendation:

#===================================================================
# Use gnuchess to decide on next move.
#
# 1. reads current position from file named $1 (.epd format)
# 2. decides what move to make (as white), using gnuchess
# 3. prints out move
# 4. also stores resulting board in dgt.chess.nextpos (.epd format)

rm -f dgt.chess.nextpos

printf "solveepd $1\nepdsave dgt.chess.nextpos\nquit\n" |
gnuchess |
grep -a 'My move is' |
sed 's/My move is : //'

H.G.Muller
Posts: 190
Joined: Sun Jul 14, 2013 10:00 am
Real Name: H.G. Muller

Re: SAN => coordinates?

Post by H.G.Muller » Mon Apr 09, 2018 10:05 pm

Why not just use an engine that already prints the moves in coordinate notation. There must be hundreds of those. All UCI engines,for starters.

kevincrawfordknight
Posts: 2
Joined: Mon Apr 09, 2018 5:54 pm

Re: SAN => coordinates?

Post by kevincrawfordknight » Tue Apr 10, 2018 12:24 am

Good idea, thank you. I installed stockfish and see that it outputs coordinate-based moves by default. All set!

Post Reply