From d9449c52d27c2479c5b741add2c657d374ea62c0 Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Sun, 28 Oct 2018 22:40:42 -0500 Subject: [PATCH] Update ChessEngine.js Rather than throwing a fit and crashing when you win, the bot now politely asks for a rematch. --- ChessEngine/js/ChessEngine.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChessEngine/js/ChessEngine.js b/ChessEngine/js/ChessEngine.js index 4ff1bd0..d9afd1f 100644 --- a/ChessEngine/js/ChessEngine.js +++ b/ChessEngine/js/ChessEngine.js @@ -25,7 +25,8 @@ class ChessBot{ game.move(nextMove); board.position(game.fen()); }else { - throw "difficulty not recognized" + this.difficulty; + alert("I concede, you win. Could we rematch though, please?"); + chess_main(); } }