-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathShell.java
36 lines (31 loc) · 1016 Bytes
/
Shell.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import java.util.*;
public class Shell {
public static void main(String[] a) {
while (true) {
var line = scanner.nextLine();
System.out.println("$" + line);
var par = line.split(" ");
var cmd = par[0];
if (cmd.equals("end")) {
break;
}
// else if (cmd.equals("init")) {
// // CRIE UM NOVO JOGO COM UM NOVO PET
// var energy = Integer.parseInt(par[1]);
// var clean = Integer.parseInt(par[2]);
// }
// else if (cmd.equals("show")) {
// }
// else if (cmd.equals("play")) {
// }
// else if (cmd.equals("shower")) {
// }
// else if (cmd.equals("sleep")) {
// }
else {
System.out.println("fail: comando invalido");
}
}
}
private static Scanner scanner = new Scanner(System.in);
}