mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 23:26:40 -08:00
Move display of title into main function
This commit is contained in:
@@ -118,9 +118,6 @@ PHASES = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
print(" " * 32 + "HANGMAN")
|
|
||||||
print(" " * 15 + "CREATIVE COMPUTING MORRISTOWN, NEW JERSEY\n")
|
|
||||||
|
|
||||||
words = ["GUM", "SIN", "FOR", "CRY", "LUG", "BYE", "FLY",
|
words = ["GUM", "SIN", "FOR", "CRY", "LUG", "BYE", "FLY",
|
||||||
"UGLY", "EACH", "FROM", "WORK", "TALK", "WITH", "SELF",
|
"UGLY", "EACH", "FROM", "WORK", "TALK", "WITH", "SELF",
|
||||||
"PIZZA", "THING", "FEIGN", "FIEND", "ELBOW", "FAULT", "DIRTY",
|
"PIZZA", "THING", "FEIGN", "FIEND", "ELBOW", "FAULT", "DIRTY",
|
||||||
@@ -133,7 +130,7 @@ words = ["GUM", "SIN", "FOR", "CRY", "LUG", "BYE", "FLY",
|
|||||||
|
|
||||||
|
|
||||||
def play_game(guess_target):
|
def play_game(guess_target):
|
||||||
"""Play the game"""
|
"""Play one round of the game"""
|
||||||
wrong_guesses = 0
|
wrong_guesses = 0
|
||||||
guess_progress = ["-"] * len(guess_target)
|
guess_progress = ["-"] * len(guess_target)
|
||||||
guess_list = []
|
guess_list = []
|
||||||
@@ -193,6 +190,8 @@ def play_game(guess_target):
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
print(" " * 32 + "HANGMAN")
|
||||||
|
print(" " * 15 + "CREATIVE COMPUTING MORRISTOWN, NEW JERSEY\n")
|
||||||
|
|
||||||
random.shuffle(words)
|
random.shuffle(words)
|
||||||
current_word = 0
|
current_word = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user