Fix Eightpieces, add some simple variants, add a basic variants classification instea...
[vchess.git] / client / src / utils / notation.js
1 // Take into account that the move may be a multi-move
2 export function getFullNotation(move, type) {
3 if (!type) type = "notation";
4 if (Array.isArray(move)) {
5 if (move.length <= 3) {
6 let notation = "";
7 for (let i=0; i<move.length; i++)
8 notation += move[i][type] + ",";
9 // Remove last comma:
10 return notation.slice(0,-1);
11 }
12 // Four sub-moves or more:
13 return "&#8734;";
14 }
15 // Simple (usual) case
16 return move[type];
17 }