- import random
- from colorama import Fore
- print("""Welcome to Spelling Bee!
- Look at the set of letters below. Your goal is to use only these letters to make words and get as
- many points as possible in 5 tries. You must use the yellow letter in all your words.
- Below you will give an estimated score you want to try to beat, around 40 points is a very good score,
- and around 25 is pretty reasonable.
- Points are given based on length of word, with the exception of 4 letter words, worth 1 point each,
- and the one pangram per letter set, worth 16 points.
- """)
- letters = ["TUANIEQ","ACENPTM","EHBAGNL","CNYHVOA","GIKNORW"]
- letterlist = [[],[],[],[],[]]
- letterlist[0] = ["antiquate","antique","aqua","aquanaut", "aquatint","equant","equate","equine",
- "equinia", "equitant","etiquette","inquinate","inquinate","netiquette","quant",
- "quantitate","quate","queen","queue","quiet","quieten","quinate","quinine",
- "quinquennia","quint","quintain","quintet","quit","quite","unique","uniquet"]
- letterlist[1] = ["emcampment","acme","amen","apeman","apemen","attempt","came","camp","cement",
- "emanate","emcee","enactment","encamp","enema","mace","mace","mama","mamma",
- "mantee","mane","manna","manta","mate","matte","mean","meant","meat","mecca",
- "meet","meme","menace","mentee","meta","mete","name","nametape","pampa","panama",
- "penman","penmen","tame","tamp","team","teammate","teem","temp","tempt","tenement"]
- letterlist[2] = ["hangable","able","alga","algae","algal","allege","allele","anal","angel","angle",
- "annal","anneal","babble","babel","bagel","bale","baleen","ball","banal","bangle",
- "beagle","beanball","bell","belle","blab","blah","eagle","elan","enable","gabble",
- "gable","gaggle","gala","galangal","gale","gall","gelee","glean","glee","glen",
- "haggle","halal","hale","hall","heal","healable","heel","hell","label","lane",
- "lean","label","lane","lean","legal"]
- letterlist[3] = ["anchovy","achoo", "achy", "ahoy", "ancho", "annoy","anon","anyhoo","cacao","cancan",
- "canna","cannon","canny","canon","canyon","cava","chancy","coach","coca","cocoa","cyan",
- "havoc","naan","nacho","nana","nanny","navy","nova","vacancy","yahoo"]
- letterlist[4] = ["working","gown","gowning","grow","growing","grown","ingrown","ironwork","ironworking",
- "kiwi","know","knowing","known","nonworking","owing","owning","rowing","wigging",
- "wiki","wing","winging","wining","wink","winking","winning","winnow","wino","wiring",
- "wonk","wooing","work","worn","wowing","wring","wringing","wrong","wronging"]
- setOfLetters = random.choice(range(len(letters)))
- #print(letterlist[setOfLetters])
- print(letters[setOfLetters][0]+letters[setOfLetters][1]+letters[setOfLetters][2]+letters[setOfLetters][3]+
- letters[setOfLetters][4]+letters[setOfLetters][5]+Fore.YELLOW+letters[setOfLetters][6])
- def spellingBee(estimate):
- points = 0
- i = 0
- pangram = False
- while i < 5:
- ans = input(Fore.WHITE + "Enter a word:")
- if ans.lower() in letterlist[setOfLetters]:
- if pangram == False:
- if ans.lower() == letterlist[setOfLetters][0]:
- points += 16
- print("Pangram! 16 points!")
- pangram = True
- else:
- if len(ans.lower()) == 4:
- print("Good Job!! 1 point!")
- points += 1
- else:
- score = len(ans)
- print("Good Job!! " + str(score) + " points!")
- points += len(ans)
- else:
- if len(ans.lower()) == 4:
- print("Good Job!! 1 point!")
- points += 1
- else:
- score = len(ans)
- print("Good Job!! " + str(score) + " points!")
- points += len(ans)
- ansind = letterlist[setOfLetters].index(ans.lower())
- letterlist[setOfLetters].pop(ansind)
- print("Score: "+ str(points))
- i=i+1
- else:
- print("That's not an acceptable word...")
- print("Your final score is " + str(points) )
- if points >= estimate:
- print ("You beat your goal by " + str(points-estimate) + "!")
- else:
- print("Restart the program to try again to beat your goal!")
- guess = input(Fore.WHITE + "Input your target score: ")
- spellingBee(int(guess))
[text] codesharecodeshareiszbestbcimightbearobotifiemailittoyou
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Editor
You can edit this paste and save as new: