Team
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

manuelBot.java 956B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package Prak1;
  2. import java.util.Scanner;
  3. public class manuelBot extends Bot {
  4. public Scanner scanner;
  5. protected manuelBot(String[] args){
  6. super(args);
  7. this.scanner = new Scanner(System.in);
  8. }
  9. public char nextMove(Bot.View view){
  10. Scanner scanner = new Scanner(System.in);
  11. String input = scanner.nextLine();
  12. char command = input.charAt(0);
  13. switch (command) {
  14. case'w':
  15. return '^';
  16. case'a':
  17. return '>';
  18. case's':
  19. return 'v';
  20. case'd':
  21. return '>';
  22. case'q':
  23. System.exit(0);
  24. default: System.out.println("ungültig");
  25. throw new RuntimeException();
  26. }
  27. }
  28. public static void main(String[] args){
  29. manuelBot ManuelBot = new manuelBot(args);
  30. ManuelBot.run();
  31. }
  32. }