Compare commits

..

No commits in common. "master" and "main" have entirely different histories.
master ... main

7 changed files with 0 additions and 315 deletions

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

1
.gitignore vendored
View File

@ -1 +0,0 @@
/bin/

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Galgen</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -1,2 +0,0 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,14 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17

View File

@ -1,192 +0,0 @@
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;
public class Galgenmann {
static HashMap<Integer, String> memory = new HashMap<>();
//test
public static void main(String[] args) throws FileNotFoundException {
Scanner sc = new Scanner(new File("src/tiere.txt"));
boolean programm = true;
ArrayList<String> animals = new ArrayList<>();
ArrayList<String> zufallstier = new ArrayList<>();
ArrayList<String> kleineschreibweise = new ArrayList<>();
int fehlversuche = 0;
while (sc.hasNext()) {
String tier = sc.next();
animals.add(tier);
}
sc.close();
int zufall = (int) (Math.random() * animals.size() - 1);
String loesung= animals.get(zufall);
String[] buchstaben = loesung.split("");
for (int i = 0; i < buchstaben.length; i++) {
zufallstier.add(buchstaben[i]);
memory.put(i, "_ ");
kleineschreibweise.add(buchstaben[i].toLowerCase());
}
System.out.println("***************************************");
System.out.println("*****Willkommen bei Galgenmännchen*****");
System.out.println("***************************************");
System.out.println();
System.out.println("Sie können zur jederzeit das Spiel verlassen mit der Eingabe #quit");
System.out.println();
System.out.println();
while (programm) {
Scanner scan = new Scanner(System.in);
System.out.println("Raten sie die Buchstaben");
// neu
for(int i = 0;i<memory.size();i++) {
System.out.print(memory.get(i));
}
System.out.println();
System.out.println();
System.out.print(" >");
System.out.println();
System.out.println();
String geraten = scan.next();
for (int i = 0; i < zufallstier.size(); i++) {
if (zufallstier.get(i).equalsIgnoreCase(geraten)) {
memory.replace(i, zufallstier.get(i));
}
}
if(geraten.equals("#quit")) {
System.out.println("Sie beenden das Programm");
break;
}
if (!kleineschreibweise.contains(geraten)) {
fehlversuche++;
}
for (int i = 0; i < memory.size(); i++) {
System.out.print(memory.get(i) );
}
if (!memory.containsValue("_ ")) {
System.out.println(" Du hast gewonnen !!");
programm = false;
fehlversuche = 10;
}
switch (fehlversuche) {
case 0:
System.out.println();
System.out.println();
System.out.println(" \\ ||");
System.out.println(" \\ ||");
System.out.println(" \\||");
System.out.println(" ||");
System.out.println(" ||");
System.out.println(" ||");
System.out.println("---------------");
break;
case 1:
System.out.println();
System.out.println();
System.out.println(" ----------");
System.out.println(" \\ ||");
System.out.println(" \\ ||");
System.out.println(" \\||");
System.out.println(" ||");
System.out.println(" ||");
System.out.println(" ||");
System.out.println("---------------");
break;
case 2:
System.out.println();
System.out.println();
System.out.println(" ----------");
System.out.println(" | ||");
System.out.println(" | ||");
System.out.println(" ||");
System.out.println(" ||");
System.out.println(" ||");
System.out.println(" ||");
System.out.println("---------------");
break;
case 3:
System.out.println();
System.out.println();
System.out.println(" ----------");
System.out.println(" | ||");
System.out.println(" | ||");
System.out.println(" o ||");
System.out.println(" ||");
System.out.println(" ||");
System.out.println(" ||");
System.out.println("---------------");
break;
case 4:
System.out.println();
System.out.println();
System.out.println(" ----------");
System.out.println(" | ||");
System.out.println(" | ||");
System.out.println(" o ||");
System.out.println(" | ||");
System.out.println(" ||");
System.out.println(" ||");
System.out.println("---------------");
break;
case 5:
System.out.println();
System.out.println();
System.out.println(" ----------");
System.out.println(" | ||");
System.out.println(" | ||");
System.out.println(" o ||");
System.out.println(" -| ||");
System.out.println(" ||");
System.out.println(" ||");
System.out.println("---------------");
break;
case 6:
System.out.println();
System.out.println();
System.out.println(" ----------");
System.out.println(" | ||");
System.out.println(" | ||");
System.out.println(" o ||");
System.out.println(" -|- ||");
System.out.println(" ||");
System.out.println(" ||");
System.out.println("---------------");
break;
case 7:
System.out.println();
System.out.println();
System.out.println(" ----------");
System.out.println(" | ||");
System.out.println(" | ||");
System.out.println(" o ||");
System.out.println(" -|- ||");
System.out.println(" / ||");
System.out.println(" ||");
System.out.println("---------------");
break;
case 8:
System.out.println();
System.out.println();
System.out.println(" ----------");
System.out.println(" | ||");
System.out.println(" | ||");
System.out.println(" o ||");
System.out.println(" -|- ||");
System.out.println(" / \\ ||");
System.out.println(" ||");
System.out.println("---------------");
System.out.println("Du hast verloren");
System.out.println("Die Lösung lautet : "+loesung);
programm=false;
}
}
}
}

View File

@ -1,79 +0,0 @@
Affe
Gorilla
Schimpanse
Schneeaffe
Elefant
Giraffe
Nashorn
Braunbär
Eisbär
Grizzly
Nasenbär
Panda
Hai
Koi
Krebs
Wels
Hund
Katze
Alpaka
Bison
Elch
Esel
Kamel
Lama
Pferd
Reh
Schaf
Tapir
Ziege
Ameise
Biene
Schabe
Delfin
Robbe
Wal
Biber
Chinchilla
Eichhörnchen
Hamster
Kaninchen
Meerschweinchen
Maus
Nacktmull
Alligator
Frosch
Gecko
Leguan
Reptil
Schildkröte
Waran
Schwein
Wildschweie
Adler
Alpensegler
Eule
Falke
Huhn
Mauerseegler
Meise
Papagei
Pinguin
Rotkehlchen
Sittich
Storch
Taube
Vogel
Gepard
Jaguar
Leopard
Luchs
Löwe
Tiger
Erdmännchen
Fledermaus
Koala
Otter
Qualle
Spinne
Wolf