From bce0574e5799137b7b1c1e7654d373778b9319db Mon Sep 17 00:00:00 2001 From: mig Date: Thu, 27 Apr 2017 04:39:46 +0200 Subject: [PATCH] added xiangqi specific move notation --- src/games/chessbase/xiangqi-model.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/games/chessbase/xiangqi-model.js b/src/games/chessbase/xiangqi-model.js index f079653..0d64547 100644 --- a/src/games/chessbase/xiangqi-model.js +++ b/src/games/chessbase/xiangqi-model.js @@ -267,5 +267,14 @@ return moveStr0; } + Model.Move.ToString = function(format) { + var self = this; + function PosName(pos) { + var col = pos % 9; + var row = (pos-col)/9; + return String.fromCharCode(("a".charCodeAt(0))+col) + row; + } + return PosName(self.f) + PosName(self.t); + } })(); \ No newline at end of file