X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fcomponents%2Fgame.js;h=4c369e4c5d990695416da38a451b2f25c08164d0;hp=3f3b55561456d29652bfd0bff21505e8d7a80ffe;hb=5188295933c6628a7f52473b8f61c93a0aaac179;hpb=3fa426b632d92a65843038a161677069de5db27e diff --git a/public/javascripts/components/game.js b/public/javascripts/components/game.js index 3f3b5556..4c369e4c 100644 --- a/public/javascripts/components/game.js +++ b/public/javascripts/components/game.js @@ -1312,7 +1312,7 @@ Vue.component('my-game', { this.endGame(this.mycolor=="w"?"0-1":"1-0"); }, newGame: function(mode, fenInit, color, oppId) { - const fen = "nrqkbrnb/pppppppp/8/8/8/8/PPPPPPPP/RKQBNRBN w 1111 -";//fenInit || VariantRules.GenRandInitFen(); + const fen = fenInit || VariantRules.GenRandInitFen(); console.log(fen); //DEBUG if (mode=="human" && !oppId) { @@ -1391,7 +1391,7 @@ Vue.component('my-game', { else if (mode == "computer") { this.compWorker.postMessage(["init",this.vr.getFen()]); - this.mycolor = "w";//(Math.random() < 0.5 ? 'w' : 'b'); + this.mycolor = (Math.random() < 0.5 ? 'w' : 'b'); if (this.mycolor != this.vr.turn) this.playComputerMove(); } @@ -1622,10 +1622,7 @@ Vue.component('my-game', { if (["human","computer","friend"].includes(this.mode)) this.updateStorage(); //after our moves and opponent moves if (this.mode == "computer" && this.vr.turn != this.mycolor && this.score == "*") - { - console.log(this.vr.moves.length + " " + this.vr.turn + " " + this.mycolor); this.playComputerMove(); - } }, undo: function() { // Navigate after game is over