Aylin, Isabella, Edasu, Jasmin
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.

ManualBot.java 811B

1234567891011121314151617181920212223242526272829303132333435
  1. package bot;
  2. import java.util.Scanner;
  3. public class ManualBot extends Bot {
  4. public ManualBot (String[] args){
  5. super(args);
  6. }
  7. public static void main (String[] args){
  8. ManualBot manualbot = new ManualBot(args);
  9. manualbot.run();
  10. }
  11. @Override
  12. protected char nextMove(View view) throws Exception {
  13. Scanner scanner = new Scanner(System.in);
  14. char move = scanner.nextLine().charAt(0);
  15. switch (move) {
  16. case 'w':
  17. case's':
  18. case'a':
  19. case'd':
  20. case'q':
  21. return move;
  22. default:
  23. System.out.println("Falsche Taste. Bitte geben sie w,s,a,d,q ein danke.");
  24. return nextMove(view);
  25. }
  26. }
  27. }