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

1234567891011121314151617181920212223242526272829
  1. import java.util.Scanner;
  2. public class ManualBot extends Bot {
  3. public static void main(String[] args) {
  4. Bot bot = new ManualBot(args);
  5. bot.run();
  6. }
  7. protected ManualBot(String[] args) {
  8. super(args);
  9. }
  10. @Override
  11. protected char nextMove(View view) throws Exception {
  12. Scanner scanner = new Scanner(System.in);
  13. String input = scanner.nextLine();
  14. if(input.equals("q"))
  15. throw new RuntimeException("Quit");
  16. return switch (input) {
  17. case "w" -> '^';
  18. case "a" -> '<';
  19. case "s" -> 'V';
  20. case "d" -> '>';
  21. default -> 'E';
  22. };
  23. }
  24. }