Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # wisielec
- import random
- GRAFIKA =[
- """
- ___________
- ||--------
- ||/
- ||
- ||
- ||
- ||
- ||
- ||
- """
- ,
- """
- ___________
- ||--------|
- ||/ |
- || |
- ||
- ||
- ||
- ||
- ||
- """
- ,
- """
- ___________
- ||--------|
- ||/ |
- || |
- || O
- ||
- ||
- ||
- ||
- """
- ,
- """
- ___________
- ||--------|
- ||/ |
- || |
- || O
- || /
- ||
- ||
- ||
- """
- ,
- """
- ___________
- ||--------|
- ||/ |
- || |
- || O
- || /|
- ||
- ||
- ||
- """
- ,
- """
- ___________
- ||--------|
- ||/ |
- || |
- || O
- || /|\
- ||
- ||
- ||
- """
- ,
- """
- ___________
- ||--------|
- ||/ |
- || |
- || O
- || /|\
- || /
- ||
- ||
- """
- ,
- """
- ___________
- ||--------|
- ||/ |
- || |
- || O
- || /|\
- || / \
- ||
- ||
- """]
- slowa = ["woda","ogien","powietrze","ziemia"]
- while slowa:
- aktualny_stan_powieszenia = 0
- choice = random.choice(slowa)
- tajemnicze_slowo = '-' * len(choice)
- print("wybrano słowo, ma {0} liter.".format(len(choice)))
- while aktualny_stan_powieszenia < 7:
- litera = input("podaj literkę: ")
- if litera in choice:
- nowy = ""
- for i in range(len(choice)):
- if choice[i] == litera:
- nowy += choice[i];
- else:
- nowy += tajemnicze_slowo[i]
- print("jest taka litera w slowie")
- print(nowy)
- tajemnicze_slowo = nowy
- if tajemnicze_slowo == choice:
- print("brawo, koniec gry")
- break
- else:
- print("nie ma takiej litery w slowie")
- aktualny_stan_powieszenia += 1
- print(GRAFIKA[aktualny_stan_powieszenia])
- if aktualny_stan_powieszenia > 6:
- print("przegrales.")
- break
- nextgame = input("chcesz jeszcze zagrac?")
- if nextgame == "nie":
- break
- else:
- slowa.remove(choice)
- continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement