X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fbase_rules.js;h=9f6ec9ecbb2b2e7ff3d197422d37462cb50cb9a7;hb=b955c65b942d09d24b5c3bed0d755d4f2f8f71f1;hp=7db4cfdebaa7459c713adb7ea36d1cee77ed421c;hpb=7d9e99bc177972c5af8b1b45f4bfb043d8306f30;p=vchess.git diff --git a/public/javascripts/base_rules.js b/public/javascripts/base_rules.js index 7db4cfde..9f6ec9ec 100644 --- a/public/javascripts/base_rules.js +++ b/public/javascripts/base_rules.js @@ -1316,42 +1316,4 @@ class ChessRules (move.vanish.length > move.appear.length ? "x" : "") + finalSquare; } } - - // Complete the usual notation, may be required for de-ambiguification - getLongNotation(move) - { - // Not encoding move. But short+long is enough - return V.CoordsToSquare(move.start) + V.CoordsToSquare(move.end); - } - - // The score is already computed when calling this function - getPGN(moves, mycolor, score, fenStart, mode) - { - let pgn = ""; - pgn += '[Site "vchess.club"]\n'; - const opponent = mode=="human" ? "Anonymous" : "Computer"; - pgn += '[Variant "' + variant + '"]\n'; - pgn += '[Date "' + getDate(new Date()) + '"]\n'; - // TODO: later when users are a bit less anonymous, use better names - const whiteName = ["human","computer"].includes(mode) - ? (mycolor=='w'?'Myself':opponent) - : "analyze"; - const blackName = ["human","computer"].includes(mode) - ? (mycolor=='b'?'Myself':opponent) - : "analyze"; - pgn += '[White "' + whiteName + '"]\n'; - pgn += '[Black "' + blackName + '"]\n'; - pgn += '[Fen "' + fenStart + '"]\n'; - pgn += '[Result "' + score + '"]\n\n'; - - // Print moves - for (let i=0; i