2

I am building a chess board where I have one LED for each column and row, so I can represent moves by iluminating the orogin coordinate (e2) and the destination coordinate (e4)

However chess algebraic notation is simplified and the origin and destination coordinates need additional info to be calculated (like the board and the rules for each piece)

I am looking for some library or function that does this convertion (any language is fine).

Basically I need this function to translate my board coordinates to a chess engine notation and viceversa.

4

Java: https://github.com/bhlangonijr/chesslib/tree/master/src/main/java/com/github/bhlangonijr/chesslib

C++: https://github.com/alexmdc/chesslib

Python: https://pypi.org/project/python-chess/

C: https://sourceforge.net/projects/sankit/

These are all able to return long algebraic notation. Stockfish is reported to also.

2

https://github.com/niklasf/python-chess

Parses and creates SAN representation of moves.

>>> board = chess.Board()
>>> board.san(chess.Move(chess.E2, chess.E4))
'e4'
>>> board.parse_san('Nf3')
Move.from_uci('g1f3')
>>> board.variation_san([chess.Move.from_uci(m) for m in ["e2e4", "e7e5", "g1f3"]])
'1. e4 e5 2. Nf3'

Do you see "g1f3" translates to Nf3?

  • thanks, I'll take a look and see if I can adapt it to my needs – Sembei Norimaki Jul 19 '18 at 14:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.