changed project structure
This commit is contained in:
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
16
src/de/javagames/Functions.java
Normal file
16
src/de/javagames/Functions.java
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
17
src/de/javagames/Main.java
Normal file
17
src/de/javagames/Main.java
Normal 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();
|
||||
}
|
||||
}
|
||||
35
src/de/javagames/Spielekonsole.java
Normal file
35
src/de/javagames/Spielekonsole.java
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
30
src/de/javagames/Spieler.java
Normal file
30
src/de/javagames/Spieler.java
Normal 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ß.");
|
||||
}
|
||||
}
|
||||
7
src/de/temprechner/Main.java
Normal file
7
src/de/temprechner/Main.java
Normal file
@@ -0,0 +1,7 @@
|
||||
package de.temprechner;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
}
|
||||
4
src/de/temprechner/TempRechner.java
Normal file
4
src/de/temprechner/TempRechner.java
Normal file
@@ -0,0 +1,4 @@
|
||||
package de.temprechner;
|
||||
|
||||
public class TempRechner {
|
||||
}
|
||||
Reference in New Issue
Block a user