Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
711ae8eb5c |
@@ -1,4 +1 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
.idea/
|
||||
Generated
+3
@@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
||||
Generated
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.9 (pythonProject)" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9 (pythonProject)" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
Generated
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/pythonProject.iml" filepath="$PROJECT_DIR$/.idea/pythonProject.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
Generated
+10
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
Generated
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import random
|
||||
|
||||
print ("Hallo! Willkommen bei MikaGPT. Was kann ich für Sie tun?")
|
||||
|
||||
woerter = {
|
||||
"test": "bro... dies ist ein Test",
|
||||
}
|
||||
|
||||
zwoerter = ["Oh, wirklich?", "Nuh uh"]
|
||||
|
||||
while True:
|
||||
uinput = (input("Bitte Eingabe beginnen ").lower().split())
|
||||
if "bye" in uinput:
|
||||
print("MikaGPT wird nun beendet.")
|
||||
break
|
||||
|
||||
randoma = set(uinput).isdisjoint(set(woerter))
|
||||
|
||||
if randoma == True:
|
||||
print (random.choice(zwoerter))
|
||||
|
||||
for antworten in uinput:
|
||||
if antworten in woerter:
|
||||
print(woerter[antworten])
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
import random
|
||||
|
||||
lottozahlen_alle = list(range(1,50))
|
||||
|
||||
gewinnzahlen = random.sample(lottozahlen_alle, 6)
|
||||
|
||||
gewinnzahlen.sort()
|
||||
|
||||
print(gewinnzahlen)
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
import random
|
||||
|
||||
rzahl = (random.randint(1,100))
|
||||
|
||||
Versuch = 1
|
||||
while Versuch < 8:
|
||||
print("Willkommen im Spiel, welche Zahl rätst du?")
|
||||
gzahl = input("Bitte Zahl eingeben: ")
|
||||
try:
|
||||
gzahl = int(gzahl)
|
||||
if gzahl < 1 or gzahl > 100:
|
||||
print("Die Zahl ist um"), print(gzahl-100), print("zu groß")
|
||||
continue
|
||||
except ValueError:
|
||||
print("Bruder... das ist keine erlaubte Zahl")
|
||||
continue
|
||||
|
||||
|
||||
Versuch = Versuch + 1
|
||||
if gzahl > rzahl:
|
||||
print("zu groß")
|
||||
if gzahl < rzahl:
|
||||
print("zu klein")
|
||||
if gzahl == rzahl:
|
||||
print ("Gewonnen!")
|
||||
break
|
||||
|
||||
print("Es war", rzahl)
|
||||
-76
@@ -1,76 +0,0 @@
|
||||
import random
|
||||
|
||||
woerter = ['Hund', 'Katze', 'Maus', 'Pferd', 'Laurenz']
|
||||
versuche = 7
|
||||
|
||||
ratewort = random.choice(woerter)
|
||||
|
||||
erraten = []
|
||||
falsche_bs = []
|
||||
tracker_fbs = 0
|
||||
|
||||
nutzereingabe = ""
|
||||
# speichert die Variable Nutzereingabe, damit später wieder drauf zugegriffen werden kann
|
||||
|
||||
|
||||
for buchstaben in ratewort:
|
||||
erraten.append('_')
|
||||
|
||||
# Für jeden Substring (Buchstaben) im zu erratenen Wort fügt er zur Liste "erraten" einen Unterstrich hinzu
|
||||
|
||||
print("Willkommen zu Mikamännchen! Du musst ein Wort erraten, zu Anfang ist dir nur die Länge bekannt. Du kannst nur einen Buchstaben pro Versuch raten, sollte er nicht im Wort vorkommen, wird Dir ein Leben abgezogen. Du hast sieben Leben.")
|
||||
|
||||
while versuche > 0:
|
||||
|
||||
for eintrag in erraten:
|
||||
print(eintrag, end=" ")
|
||||
|
||||
# Geht jedes Zeichen in der Liste "erraten" durch und printet es, end="" macht, dass es ohne Zeilenumbreich in eine Zeile ausgegeben wird
|
||||
|
||||
print()
|
||||
print("Verbleibende Leben:", versuche)
|
||||
|
||||
if tracker_fbs > 0:
|
||||
print("Falsche Buchstaben bisher:", ", ".join(falsche_bs))
|
||||
|
||||
|
||||
nutzereingabe = input("Dein Vorschlag? ").lower()
|
||||
|
||||
if nutzereingabe == ratewort:
|
||||
print("Schummler.")
|
||||
break
|
||||
|
||||
if nutzereingabe in falsche_bs:
|
||||
print("Den hast du schon (falsch) erraten, Kollege")
|
||||
continue
|
||||
|
||||
if len(nutzereingabe) != 1:
|
||||
print("Bitte nur ein Buchstabe!")
|
||||
continue
|
||||
|
||||
x = 0
|
||||
|
||||
richtig = False
|
||||
|
||||
for buchstaben in ratewort:
|
||||
|
||||
if nutzereingabe == buchstaben.lower():
|
||||
print("Treffer!")
|
||||
erraten[x] = ratewort[x]
|
||||
richtig = True
|
||||
x = x + 1
|
||||
|
||||
if richtig != True:
|
||||
versuche = versuche - 1
|
||||
falsche_bs.append(nutzereingabe)
|
||||
tracker_fbs = tracker_fbs + 1
|
||||
|
||||
|
||||
if versuche == 0:
|
||||
print("Das war Dein letztes Leben, das Spiel ist beendet. Das Wort war:", ratewort)
|
||||
|
||||
if '_' not in erraten:
|
||||
print("Gewonnen!")
|
||||
print("Das Wort war:", ratewort)
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user