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 755B

123456789101112131415161718192021222324252627282930
  1. import java.util.Scanner;
  2. public class ManualBot extends Bot{
  3. public static void main(String[] args) {
  4. Bot manualBot = new ManualBot(args);
  5. manualBot.run();
  6. }
  7. protected ManualBot(String[] args) {
  8. super(args);
  9. }
  10. protected char nextMove(View view) throws Exception{
  11. Scanner scanner = new Scanner(System.in);
  12. switch(scanner.nextLine().toLowerCase()){
  13. case "w":
  14. return '^' ;
  15. case "s":
  16. return 'v' ;
  17. case "a":
  18. return '<' ;
  19. case "d":
  20. return '>' ;
  21. case "q":
  22. throw new Exception();
  23. default:
  24. break;
  25. }
  26. return 0;
  27. }
  28. }