From 19bda5b5cf8123a850ed9024e9c4ec068fb6eba3 Mon Sep 17 00:00:00 2001 From: FelixL <50499590+SlaynAndKorpil@users.noreply.github.com> Date: Thu, 14 May 2020 19:09:40 +0200 Subject: [PATCH] closed #52 --- console/src/console/InputInterpreter.scala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/console/src/console/InputInterpreter.scala b/console/src/console/InputInterpreter.scala index e33441a..35a690a 100644 --- a/console/src/console/InputInterpreter.scala +++ b/console/src/console/InputInterpreter.scala @@ -40,10 +40,10 @@ class InputInterpreter(loadGameFrom: String) extends ChessIO with CommandRegistr private var reject: Input[_] = _ /** - * Runs an interpretation of the console and plays the interpreted moves on the [[InputInterpreter#board board]]. + * Runs an interpretation of the console and plays the interpreted moves on the [[console.InputInterpreter#board board]]. */ def run(): Unit = { - print("Welcome to my gorgeous CLI chess game! Type 'help' and then press ENTER to get a list of available commands.\n\n") + print("Welcome to my gorgeous CLI chess game! Type \"help\" and then press 'ENTER' to get a list of available commands.\n\n") println(board) gameLoop() @@ -106,7 +106,7 @@ class InputInterpreter(loadGameFrom: String) extends ChessIO with CommandRegistr if (input.isEmpty) NoMessage else if (existsCommand(commandName)) { val command = allCommandBindings(commandName) - command(words.filterNot(_.isEmpty).tail.mkString(" ")) + command(words.filter(_.nonEmpty).tail.mkString(" ")) } else if (isMoveCommand(input)) parseMove(input) else Message(commandErrorMessage) @@ -142,7 +142,7 @@ class InputInterpreter(loadGameFrom: String) extends ChessIO with CommandRegistr override val names: Array[String] = Array("load") override val paramInfo: String = "" - override def apply(params: String): Message = load(params) match { + override def apply(params: String): Message = load(params.filter(_ != '"')) match { case Some(error) => Message("ERROR: " + error.description) case None => Message("Successfully loaded!") } @@ -155,7 +155,7 @@ class InputInterpreter(loadGameFrom: String) extends ChessIO with CommandRegistr override val names: Array[String] = Array("save", "s", "write", "w") override val paramInfo: String = "" - override def apply(params: String): Message = save(params) match { + override def apply(params: String): Message = save(params.filter(_ != '"')) match { case Some(error) => Message("ERROR: " + error.description) case None => Message("Successfully saved!") }