- this.moves.forEach((move,idx) => {
- // Strategy working also for multi-moves:
- if (!Array.isArray(move)) move = [move];
- const Lm = move.length;
- move.forEach((m,idxM) => {
- m.notation = this.vr.getNotation(m);
- m.unambiguous = V.GetUnambiguousNotation(m);
- this.vr.play(m);
- const checkSquares = this.vr.getCheckSquares();
- if (checkSquares.length > 0) m.notation += "+";
- if (idxM == Lm - 1) m.fen = this.vr.getFen();
- if (idx == L - 1 && idxM == Lm - 1) {
- this.incheck = checkSquares;
- this.score = this.vr.getCurrentScore();
- if (["1-0", "0-1"].includes(this.score)) m.notation += "#";
- }
+ else {
+ this.moves.forEach((move,idx) => {
+ // Strategy working also for multi-moves:
+ if (!Array.isArray(move)) move = [move];
+ const Lm = move.length;
+ move.forEach((m,idxM) => {
+ m.notation = this.vr.getNotation(m);
+ m.unambiguous = V.GetUnambiguousNotation(m);
+ this.vr.play(m);
+ const checkSquares = this.vr.getCheckSquares();
+ if (checkSquares.length > 0) m.notation += "+";
+ if (idxM == Lm - 1) m.fen = this.vr.getFen();
+ if (idx == L - 1 && idxM == Lm - 1) {
+ this.incheck = checkSquares;
+ this.score = this.vr.getCurrentScore();
+ if (["1-0", "0-1"].includes(this.score)) m.notation += "#";
+ }
+ });