-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathShell.java
40 lines (34 loc) · 1.11 KB
/
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
37
38
39
40
import java.util.Scanner;
public class Shell {
public static void main(String[] _args) {
// Animal animal = new Animal("", "");
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") ) {
// INICIE O ANIMAL UTILIZANDO O CONSTRUTOR
// var species = par[1];
// var noise = par[2];
}
else if (cmd.equals("show")) {
// MOSTRE O ANIMAL
}
else if (cmd.equals("noise")) {
// OBTER O BARULHO DO ANIMAL E IMPRIMA
}
else if (cmd.equals("grow") ) {
// AUMENTE A IDADE DO ANIMAL
// var increment = Integer.parseInt(par[1]);
}
else {
System.out.println("fail: comando invalido\n");
}
}
}
static Scanner scanner = new Scanner(System.in);
}