From 4735175c47153782bf029536a1fb4e108bd272fd Mon Sep 17 00:00:00 2001 From: Orlando Boyny Date: Thu, 21 Dec 2023 15:23:47 +0000 Subject: [PATCH] =?UTF-8?q?Dateien=20hochladen=20nach=20=E2=80=9E=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manuelBot.java | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 manuelBot.java diff --git a/manuelBot.java b/manuelBot.java new file mode 100644 index 0000000..830a9e5 --- /dev/null +++ b/manuelBot.java @@ -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(); + } +}