-
-
Save hclivess/0721fbb59f1f86dadb6032fe39567634 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Drak: | |
| def __init__(self): | |
| self.hp = 100 | |
| class RybiKosik: | |
| def __init__(self): | |
| self.pocet = 0 | |
| drak = Drak() | |
| kosik = RybiKosik() | |
| def volbaA(): | |
| print("Jsi v dracim doupeti") | |
| action = input("Jakou silou zautocit na draka? (1-100): ") | |
| drak.hp = drak.hp - int(action) | |
| print(f"Drak ma {drak.hp} HP") | |
| if drak.hp < 10: | |
| print("Drak je tezce zranen a prosi o slitovani") | |
| if drak.hp < 1: | |
| print("Drak je mrtev, konec hry") | |
| input("Stiskni klavesu pro pokracovani") | |
| exit() | |
| def volbaB(): | |
| print("Prosel jsi se po vesnici a nadychal se cerstveho vzduchu. Drak se mezitim vylecil.") | |
| drak.hp = drak.hp + 1 | |
| print(f"Drak ma {drak.hp} HP") | |
| def volbaC(): | |
| print("Vitej u rybnika") | |
| action = input("Kolik hodin chces chytat ryby? (1-100): ") | |
| nachytano = int(int(action) / 10) | |
| kosik.pocet = kosik.pocet + nachytano | |
| print(f"V kosiku mas {kosik.pocet} ryb") | |
| while True: | |
| i = input("a = zautocit na draka\n" | |
| "b = zautocit na draka, projit se po vesnici, lovit ryby\n" | |
| "c = lovit ryby\n") | |
| if i == "a": | |
| volbaA() | |
| if i == "b": | |
| volbaA() | |
| volbaB() | |
| volbaC() | |
| if i == "c": | |
| volbaC() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment