diff --git a/komp/uebung-2024.html b/komp/uebung-2024.html index 32384b8..f2bbee6 100644 --- a/komp/uebung-2024.html +++ b/komp/uebung-2024.html @@ -3,7 +3,7 @@ - Document + Aufgabe KOMP + + +
+
+

E DICER


+ Würfeln
+
+

Die Ergebnisse werden sortiert wie folgt sortiert: Klein >> Groß

+

powered by Daniel

+
+
+
+
+ \n"; + } + // Array ausgeben + /*echo "
";
+    print_r($augen_array);
+    echo"
"; + */ + sort($augen_array); + $haeufigkeit = array_count_values($augen_array); + sort($haeufigkeit); + + // Die Würfel zeigen + for ($i=0; $i<$anzahl; $i++){ + echo "$augen_array[$i] Augen\n"; + } + + // Ausgabe der Augenzahlen + $summe = array_sum($augen_array); + echo "
"; + echo "

Die Summe der Augenzahlen beträgt $summe

"; + echo "
"; + echo "
"; + +// GEWINN ERMITTELN + // KNIFFEL + if (count(array_unique($augen_array))==1){ // Fünf gleiche Zahlen = Kniffel + echo "

🎉 KNIFFEL! :) 🎉

"; + echo "

5️⃣

"; + } + // VIERERPASCH + elseif ($haeufigkeit === [1,4]){ // das geht auch um 3 gleiche zu bekommen + echo "

4️⃣ VIERERPASCH :) 🎉

"; + } + // FULL HOUSE + elseif ($haeufigkeit === [2,3]) { + echo "

3️⃣ FULL HOUSE :) 🎉

"; + } + // DREIERPASCH + elseif ($haeufigkeit === [1,1,3]) { + echo "

3️⃣ DREIERPASCH :) 🎉

"; + } + // DOPPEL ZWEIERPASCH + elseif ($haeufigkeit === [1,2,2]) { + echo "

2️⃣ DOPPEL ZWEIERPASCH

"; + } + // ZWEIERPASCH + elseif ($haeufigkeit === [1,1,1,2]) { + echo "

2️⃣ ZWEIERPASCH :/ 🆗

"; + } + // KEIN GEWINN + else{ + echo "

❌ KEIN GEWINN.❌

"; + echo "

:(

"; + } + echo "
"; + ?> + + diff --git a/progp/24-12-4/edicer.html b/progp/24-12-4 -- edicer 1/edicer.html similarity index 100% rename from progp/24-12-4/edicer.html rename to progp/24-12-4 -- edicer 1/edicer.html diff --git a/progp/24-12-4/edicer.js b/progp/24-12-4 -- edicer 1/edicer.js similarity index 100% rename from progp/24-12-4/edicer.js rename to progp/24-12-4 -- edicer 1/edicer.js diff --git a/progp/24-12-4/edicer.php b/progp/24-12-4 -- edicer 1/edicer.php similarity index 100% rename from progp/24-12-4/edicer.php rename to progp/24-12-4 -- edicer 1/edicer.php diff --git a/progp/24-12-4/kleinearray.php b/progp/24-12-4 -- edicer 1/kleinearray.php similarity index 100% rename from progp/24-12-4/kleinearray.php rename to progp/24-12-4 -- edicer 1/kleinearray.php diff --git a/progp/24-12-4/messwerte.php b/progp/24-12-4 -- edicer 1/messwerte.php similarity index 100% rename from progp/24-12-4/messwerte.php rename to progp/24-12-4 -- edicer 1/messwerte.php