changed project structure

This commit is contained in:
2025-02-20 12:17:18 +01:00
parent b117d476fd
commit 906e95d949
8 changed files with 115 additions and 15 deletions

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@@ -1,15 +0,0 @@
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
public static void main(String[] args) {
//TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
// to see how IntelliJ IDEA suggests fixing it.
System.out.printf("Hello and welcome!");
for (int i = 1; i <= 5; i++) {
//TIP Press <shortcut actionId="Debug"/> to start debugging your code. We have set one <icon src="AllIcons.Debugger.Db_set_breakpoint"/> breakpoint
// for you, but you can always add more by pressing <shortcut actionId="ToggleLineBreakpoint"/>.
System.out.println("i = " + i);
}
}
}

View File

@@ -0,0 +1,16 @@
package de.javagames;
public class Functions {
public static void wait(int seconds)
{
try
{
Thread.sleep(seconds * 1000);
}
catch(InterruptedException ex)
{
Thread.currentThread().interrupt();
}
}
}

View File

@@ -0,0 +1,17 @@
package de.javagames;
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
public static void main(String[] args) {
//Erzeugen einer Spielekonsole
Spielekonsole alpha = new Spielekonsole();
Spieler spieler = new Spieler();
//alpha.hello();
//spieler.machBenutzerEingabe();
//alpha.goodbye();
alpha.spielnr();
}
}

View File

@@ -0,0 +1,35 @@
package de.javagames;
import java.util.Scanner;
public class Spielekonsole {
//Methode, die den Spielern bei Start begrüßt
public void hello() {
System.out.println("Hallo Spieler der JavaGames GmbH!");
}
public void goodbye() {
System.out.println("Auf Wiedersehen!");
}
Scanner scan = new Scanner(System.in);
public void spielnr() {
System.out.print("Bitte wähle ein Spiel von 1-3 aus: ");
int spielnr = scan.nextInt();
if (spielnr == 1) {
System.out.println("Du hast Spiel 1 ausgewählt!");
}
else if (spielnr == 2) {
System.out.println("Du hast Spiel 2 ausgewählt!");
}
else if (spielnr == 3) {
System.out.println("Du hast Spiel 3 ausgewählt!");
}
else {
System.out.println("Ungültige Eingabe! Bitte versuche es erneut!");
spielnr();
}
}
}

View File

@@ -0,0 +1,30 @@
package de.javagames;
import java.util.Scanner;
public class Spieler {
public static void main(String[] args) {
machBenutzerEingabe();
}
public static void machBenutzerEingabe() {
Spieler.eingabe(new String[] {});
}
public static void eingabe(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Bitte gib deinen Namen ein: ");
String name = scanner.nextLine();
System.out.print("Bitte gib dein Alter ein: ");
int alter = scanner.nextInt();
System.out.print("Bitte gib deine Groesse in meter ein: ");
float groesse = scanner.nextFloat();
System.out.println("Hallo, " + name + "! Du bist " + alter + " Jahre alt und " + groesse + "m groß.");
}
}

View File

@@ -0,0 +1,7 @@
package de.temprechner;
public class Main {
public static void main(String[] args) {
}
}

View File

@@ -0,0 +1,4 @@
package de.temprechner;
public class TempRechner {
}