Dateien hochladen nach „“
This commit is contained in:
parent
e0c22bbd8d
commit
4735175c47
39
manuelBot.java
Normal file
39
manuelBot.java
Normal file
@ -0,0 +1,39 @@
|
||||
package Prak1;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
public class manuelBot extends Bot {
|
||||
|
||||
public Scanner scanner;
|
||||
|
||||
protected manuelBot(String[] args){
|
||||
super(args);
|
||||
this.scanner = new Scanner(System.in);
|
||||
}
|
||||
|
||||
public char nextMove(Bot.View view){
|
||||
Scanner scanner = new Scanner(System.in);
|
||||
String input = scanner.nextLine();
|
||||
char command = input.charAt(0);
|
||||
switch (command) {
|
||||
case'w':
|
||||
return '^';
|
||||
case'a':
|
||||
return '>';
|
||||
case's':
|
||||
return 'v';
|
||||
case'd':
|
||||
return '>';
|
||||
case'q':
|
||||
System.exit(0);
|
||||
default: System.out.println("ungültig");
|
||||
throw new RuntimeException();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args){
|
||||
manuelBot ManuelBot = new manuelBot(args);
|
||||
ManuelBot.run();
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user