<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># game.py
# Anne Bracy (awb93), Daisy Fan (kdf4)
# April, 2020
""" Module to play a word guessing game
"""

import random, wordGuess

def guess_the_word(secret, n_guesses_left):
    if secret.is_solved():
        print("YOU WIN!!!")
    elif n_guesses_left==0:
        print("Sorry you're out of guesses")
    else:
        secret.print_word_so_far()
        user_guess= input("Guess a letter: ")
        secret.apply_guess(user_guess)
        guess_the_word(secret, n_guesses_left-1)

# from 100 Words to Make You Sound Great by Editors of the American Heritage Dictionaries
# https://www.hmhco.com/shop/books/100-Words-to-Make-You-Sound-Great/9780618883103
word_list = ["adamant", "affectation", "affinity", "allay", "amelioration", "amenable", "amoral", "assuage", "bauble", "beguile", "beset", "bulwark", "busybody", "complacent", "concomitant", "consign", "contend", "cosmopolitan", "culpable", "depravity", "derelict", "dissimulate", "dissipate", "distill", "dogmatic", "elicit", "epithet", "espouse", "expediency", "forestall", "furtive", "galling", "gloat", "gratuitous", "hallmark", "happenstance", "ignominious", "imperturbable", "ingratiate", "innocuous", "intemperate", "interpolate", "inure", "jingoism", "juggernaut", "ken ", "latent", "legacy", "ludicrous", "mandate", "maven", "mawkish", "modus operandi", "nefarious", "nicety", "nonchalance", "obdurate", "orthodoxy", "palliate", "patina", "penury", "pernicious", "perpetuate", "pittance", "pompous", "precipitate", "prescience", "profusion", "propensity", "pugnacity", "pusillanimous", "quip", "rankle", "reconciliation", "resiliency", "respite", "riposte", "sacrosanct", "scapegoat", "spurious", "squander", "supersede", "surreptitious", "tenacity", "tenuous", "travail", "truculence", "turpitude", "tyro", "unbridled", "uncanny", "urbane", "velleity", "venial", "verbose", "vexation", "vista", "wanton", "wheedle", "yammer"]

N_GUESSES = 10
print('You have '+str(N_GUESSES)+ ' chances to guess the secret word ...')
secret = wordGuess.SecretWord(random.choice(word_list))
guess_the_word(secret, N_GUESSES)
secret.reveal()
</pre></body></html>