gbtami / pychess-variants

Chess variant server
https://www.pychess.org
GNU Affero General Public License v3.0
240 stars 117 forks source link

Implement Asian Xiangqi Notation (AXN) #434

Closed ugoproto closed 1 year ago

ugoproto commented 3 years ago

The AXN is different from the PGN. It's a relative notation. An opening example:

Red Black C2=5 H8+7 red Cannon moves from file 2 to file 5, black Horse in file 8 advances and switches to file 7 H2+3 R9=8 red Horse in f2 advances and switches to f3, black chaRiot moves sideway from f9 to f8 R1=2 H2+3 red chaRiot in f1 moves sideway to f2, black Horse in f2 moves up and switches to f3

Is it possible to implement that notation in PyChess for Xiangqi and games related to Xiangqi?

A first step would be to adjust the boards: a Xiangqi board has a series of files, from 1 to 9, on the top (black players) and from 9 to 1 at the botton (red player); clockwise, it goes from 1 to 9 (top), and 1 to 9 again (bottom). That could be added without removing the algebraic notation.

A second step would be to record moves according to the AXN. I understand StockFish is based on PGN, but AXN would be added (not a replacement for PGN).

Here is an example from a Chinese software: http://xiangqibowl.org/?p=1568

gbtami commented 3 years ago

We plan to change to WXF notation as default, see https://github.com/gbtami/pychess-variants/issues/332

gbtami commented 2 years ago

WXF File format https://www.wxf-xiangqi.org/images/computer-xiangqi/chinese-chess-file-format.pdf

gbtami commented 1 year ago

Fixed via https://github.com/gbtami/pychess-variants/commit/a2ef7cf45580c3c7665b0ef4789178d2875017a6