Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #rozkres chyb
- chyba1 = ("""
- ~~~~~~~""")
- chyba2 = ("""
- +
- |
- |
- |
- |
- |
- ~~~~~~~""")
- chyba3 = ("""
- +---.
- |
- |
- |
- |
- |
- ~~~~~~~""")
- chyba4 = ("""
- +---.
- | |
- |
- |
- |
- |
- ~~~~~~~""")
- chyba5 = ("""
- +---.
- | |
- | O
- |
- |
- |
- ~~~~~~~""")
- chyba6 = ("""
- +---.
- | |
- | O
- | |
- |
- |
- ~~~~~~~""")
- chyba7 = ("""
- +---.
- | |
- | O
- | --|
- |
- |
- ~~~~~~~""")
- chyba8 = ("""
- +---.
- | |
- | O
- | --|--
- |
- |
- ~~~~~~~""")
- chyba9 = ("""
- +---.
- | |
- | O
- | --|--
- | /
- |
- ~~~~~~~""")
- chyba10 = ("""
- +---.
- | |
- | O
- | --|--
- | / \
- |
- ~~~~~~~""")
- #funkce tahu
- def tah(slovo, retezec, pismeno):
- pozice = slovo.index(pismeno)
- return retezec[:pozice] + pismeno + retezec[pozice + 1:]
- #funkce chyb
- def pocet_chyb(chyba):
- return chyba + 1
- #funkce pro vyhodnoceni sibenice
- def vyhodnot(chyba):
- if chyba == 1:
- print(chyba1)
- elif chyba == 2:
- print(chyba2)
- elif chyba == 3:
- print(chyba3)
- elif chyba == 4:
- print(chyba4)
- elif chyba == 5:
- print(chyba5)
- elif chyba == 6:
- print(chyba6)
- elif chyba == 7:
- print(chyba7)
- elif chyba == 8:
- print(chyba8)
- elif chyba == 9:
- print(chyba9)
- elif chyba == 10:
- print(chyba10)
- print("Smůla, zkus to znovu")
- #cela hra
- def sibenice():
- slovo = "python"
- retezec = "------"
- chyba = 0
- while True:
- pismeno = input("Zadej pismeno: ")
- if pismeno in slovo:
- if "-" in retezec:
- hrac = tah(slovo, retezec, pismeno)
- print(hrac)
- retezec = hrac
- elif "-" not in retezec:
- print("Gratuluji. Vyhral jsi!")
- break
- elif pismeno not in slovo:
- chyby = pocet_chyb(chyba)
- chyba = chyby
- vyhodnot(chyba)
- if chyba == 10:
- break
- sibenice()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement