Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #separate cell
- def whattoguess(word):
- for char in word:
- print(char, end = '')
- print()
- from IPython.display import clear_output
- import random
- consonants = ['B','C','D','F','G','H','J','K','L','M','N','P','Q','R','S','T','V','W','X','Y','Z']
- vowels = ['A','E','I','O','U']
- prize = 0
- values = ["BANKRUPT", 500, 550, 600, 650, 700, 750, 800, 850, 2500]
- word = input("Please enter a string for the player to guess: ")
- clear_output()
- phrase = []
- for char in word:
- if char.isalpha():
- phrase.append('-')
- else:
- phrase.append(char)
- while True:
- print("\nGuess the phrase: ")
- whattoguess(phrase)
- print(" 1) Spin the wheel")
- print(" 2) Buy a vowel")
- print(" 3) Solve the puzzle")
- print("\nUnused consonants: ", *consonants, sep="")
- print("\nUnused vowels: ",*vowels, sep="")
- print("\nPrize pool:", prize)
- a = input("\nEnter action: ")
- if a == "1":
- prizewon = random.choice(values)
- if prizewon == "BANKRUPT":
- print("\nThe wheel lands at:", prizewon)
- print("\nThough luck! Prize pool resets to 0.")
- prize = 0
- else:
- print("\nThe wheel lands at:", prizewon)
- c = input("\nEnter consonant: ")
- for n, i in enumerate(consonants):
- if i == c:
- consonants[n] = ""
- if c in word:
- print("\n",c, "is found!")
- for i, n in enumerate(word):
- if n != '-' and c == n:
- phrase[i] = n
- prize = prize + (prizewon * phrase.count(c))
- if c not in word:
- prize = prize
- print("\nSorry,", c, "is not found.")
- if a == "2":
- if prize < 250:
- print("\nYou don't have enough money to buy a vowel.")
- else:
- prize = prize - 250
- v = input("\nEnter vowel: ")
- for n, i in enumerate(vowels):
- if i == v:
- vowels[n] = ""
- if v in word:
- print("\nAll", v,"\b's shown.")
- for i, n in enumerate(word):
- if n != '-' and v == n:
- phrase[i] = n
- if v not in word:
- print("\nSorry,", v, "is not found.")
- if a == "3":
- x = input("\nEnter phrase / sentence: ")
- if x == word:
- print("\nCongratulations! You win a total of", prize, "!")
- else:
- print("\nSorry. Incorrect phrase / sentence.")
- again = input("\nPlay again(Y/N)? ")
- if again == "Y":
- consonants = ['B','C','D','F','G','H','J','K','L','M','N','P','Q','R','S','T','V','W','X','Y','Z']
- vowels = ['A','E','I','O','U']
- prize = 0
- values = ["BANKRUPT", 500, 550, 600, 650, 700, 750, 800, 850, 2500]
- word = input("Please enter a string for the player to guess: ")
- clear_output()
- phrase = []
- for char in word:
- if char.isalpha():
- phrase.append('-')
- else:
- phrase.append(char)
- continue
- elif again == 'N':
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement