From 91ccae348b59404a2dd03c5f7230332cce7ddc74 Mon Sep 17 00:00:00 2001 From: Folke Zantz Date: Thu, 4 Dec 2025 18:55:47 +0000 Subject: [PATCH] =?UTF-8?q?klitzekleine=20=C3=9Cberarbeitung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Game/game.ipynb | 119 +++++++++++++++++++++++++++++------------------- 1 file changed, 71 insertions(+), 48 deletions(-) diff --git a/Game/game.ipynb b/Game/game.ipynb index fe2af97..4a09547 100644 --- a/Game/game.ipynb +++ b/Game/game.ipynb @@ -6,48 +6,6 @@ "id": "c74a7a8e-6e0a-4f42-a18f-46b1aa7fddb1", "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Zahl\n" - ] - }, - { - "name": "stdin", - "output_type": "stream", - "text": [ - " \n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Zahl\n" - ] - }, - { - "name": "stdin", - "output_type": "stream", - "text": [ - " \n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Zahl\n" - ] - }, - { - "name": "stdin", - "output_type": "stream", - "text": [ - " \n" - ] - }, { "name": "stdout", "output_type": "stream", @@ -68,7 +26,25 @@ "name": "stdout", "output_type": "stream", "text": [ - "Zahl\n" + "Kopf (2x)\n", + "\n", + "Du hast 6.5 Coins (+ 1.0)\n" + ] + }, + { + "name": "stdin", + "output_type": "stream", + "text": [ + " \n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Kopf (3x)\n", + "\n", + "Du hast 8.0 Coins (+ 1.5)\n" ] }, { @@ -112,7 +88,37 @@ "text": [ "Kopf (1x)\n", "\n", - "Du hast 6.0 Coins (+ 0.5)\n" + "Du hast 8.5 Coins (+ 0.5)\n" + ] + }, + { + "name": "stdin", + "output_type": "stream", + "text": [ + " \n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Zahl\n" + ] + }, + { + "name": "stdin", + "output_type": "stream", + "text": [ + " \n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Kopf (1x)\n", + "\n", + "Du hast 9.0 Coins (+ 0.5)\n" ] }, { @@ -128,7 +134,23 @@ "text": [ "Kopf (2x)\n", "\n", - "Du hast 7.0 Coins (+ 1.0)\n" + "Du hast 10.0 Coins (+ 1.0)\n" + ] + }, + { + "name": "stdin", + "output_type": "stream", + "text": [ + " \n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Kopf (3x)\n", + "\n", + "Du hast 11.5 Coins (+ 1.5)\n" ] }, { @@ -154,15 +176,16 @@ "coins_per_head = 0.5\n", "coins = 5\n", "coins_amount = 1\n", + "multiplier = 0.5\n", "\n", - "def coin_flip(propability, coins, coins_per_head, coins_amount):\n", + "def coin_flip(propability, coins, coins_per_head, coins_amount, multiplier):\n", " while True:\n", " result = random.randint(0, 100)\n", " if result in range(0,propability):\n", " print(f'Kopf ({coins_amount}x)') \n", " coins_amount += 1 #Anzahl an hintereinander geworfenen \"Köpfen\"\n", " if coins_amount >=3:\n", - " coins_per_head += 0.5 #Coin-Boost für mehrfaches werfen von Kopf hintereinander\n", + " coins_per_head += multiplier #Coin-Boost für mehrfaches werfen von Kopf hintereinander\n", " else:\n", " coins_per_head = 0.5\n", " coins += coins_per_head\n", @@ -175,7 +198,7 @@ " input()\n", "\n", "\n", - "coin_flip(propability, coins, coins_per_head, coins_amount)\n" + "coin_flip(propability, coins, coins_per_head, coins_amount, multiplier)\n" ] }, {