From 8955085634c6dc5001d0b7eca574b8a1d363fb3b Mon Sep 17 00:00:00 2001 From: minabajalani Date: Sun, 9 Feb 2025 16:55:30 +0100 Subject: [PATCH] initialisierung --- .idea/.gitignore | 8 ++++++++ .idea/ManualBot.java | 40 ++++++++++++++++++++++++++++++++++++++++ .idea/SnakeBot.iml | 9 +++++++++ .idea/misc.xml | 6 ++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ 6 files changed, 77 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/ManualBot.java create mode 100644 .idea/SnakeBot.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/ManualBot.java b/.idea/ManualBot.java new file mode 100644 index 0000000..95a472b --- /dev/null +++ b/.idea/ManualBot.java @@ -0,0 +1,40 @@ + +import java.util.Scanner; + +public class ManualBot extends Bot { + public ManualBot(String [] args) { + super(args); + } + + @Override + public char nextMove(View view) { + Scanner scanner = new Scanner(System.in); + System.out.print("Geben Sie einen Steuerbefehl ein (w/s/a/d/q): "); + String input = scanner.nextLine().trim().toLowerCase(); + + switch (input) { + case "w": + return '^'; + case "s": + return 'v'; + case "a": + return '<'; + case "d": + return '>'; + case "q": + System.out.println("Verbindung abgebrochen."); + System.exit(0); + return 0; + + default: + System.out.println("Ungültiger Befehl. Bitte versuchen Sie es erneut."); + return nextMove(view); + } + } + + public static void main(String[] args) { + ManualBot bot = new ManualBot(args); + bot.run(); + } + +} diff --git a/.idea/SnakeBot.iml b/.idea/SnakeBot.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/SnakeBot.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..66f29f6 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..8289fa6 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file