Commit ee46293f authored by Chingiz's avatar Chingiz 💻

Fix changed list order

parent bb1cae7b
......@@ -120,21 +120,28 @@ export class Control {
}
start() {
let out: boolean = true;
console.log("Hello, your robot name is D2R. Please, take controle of him. \n");
console.log(
"Hello, your robot name is D2R. Please, take controle of him. \n"
);
while (out) {
const answerFromUser: string | null = readline.question(
`Choose one of the commands: \n1) ${this.robot.tool ? "Use the "+ this.robot.tool.toolName : "No tools to use!"}\n2) ${this.robot.tool ? "Drop the " + this.robot.tool.toolName : "No tools to drop!"}\n3) ${this.robot.tool ? "Your tool is " + this.robot.tool.toolName : "Choose one of the tools"}\n4) Exit:\n `
`Choose one of the commands: \n1) ${
this.robot.tool
? "Your tool is " + this.robot.tool.toolName
: "Choose one of the tools"
} \n2) ${
this.robot.tool
? "Drop the " + this.robot.tool.toolName
: "No tools to drop!"
}\n3) ${
this.robot.tool
? "Use the " + this.robot.tool.toolName
: "No tools to use!"
}\n4) Exit:\n `
);
switch (answerFromUser) {
case "1":
this.robot.action();
break;
case "2":
this.robot.drop_tool();
break;
case "3":
const answer = readline.question(
"Please, choose one of the tool: \n1) Saw\n2) Hammer\n3) screwdriver\n4) Axe\n5) Drill\n"
);
......@@ -161,8 +168,15 @@ export class Control {
break;
}
break;
case "2":
this.robot.drop_tool();
break;
case "3":
this.robot.action();
break;
case "4":
out = false;
break;
default:
console.log("============================================");
console.log("Please, choose correct command");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment