klitzekleine Überarbeitung
This commit is contained in:
119
Game/game.ipynb
119
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"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user