Skip to content

Instantly share code, notes, and snippets.

@ethanp0405
Created June 16, 2022 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ethanp0405/39c1144a7fbfdcf1ae3665a5eec70c89 to your computer and use it in GitHub Desktop.
Save ethanp0405/39c1144a7fbfdcf1ae3665a5eec70c89 to your computer and use it in GitHub Desktop.
import time
import random
import string
import time
print('Welcome to Scattergories!')
while True:
ans = input("Would you like to play Scattergories?: Yes or No")
answer_use = ans.lower()
if answer_use == "yes":
name = True
print("Great let's begin!")
break
else:
print("\nWrong answer, please try again.\n")
print("""
The rules are as follows:
Players have a specific time limit to think of a word that fits each
of the 12 Scattergories categories on the list that begin with the letter rolled.
Every word a player chooses has to be unique and creative because if another player
says the same word as you, both of you do not get any points.
""")
time.sleep(0.5)
while True:
ansp = []
answer_p = int(input("How many players? 1, 2, 3, or 4"))
if answer_p <= 4:
name = True
ansp.append(answer_p)
print(str(answer_p) + ' players selected.')
break
else:
print("\nNumber of players not supported.\n")
playernum = ansp[0]
time.sleep(1.5)
print("We will now generate a random list.")
list1 = """
1. Holiday Activities
2. Things That Will Get You Fired
3. Ways to Kill Time
4. Things That Make You Smile
5. Reasons to Call 911
6. Things That Have Buttons
7. Items You Take On A Trip
8. Things That Have Wheels
9. Titles People Can Have
10. Types of Weather
11. Reasons to Make a Phone Call
12. Things You Save Up to Buy
"""
list2 = """
1. Things You Get in the Mail
2. Things You Do Every Day
3. Things You Store Items In
4. Historic Events
5. Things to Do on a Date
6. Words Associated With Winter
7. Reasons to Take Out a Loan
8. Things That Can Kill You
9. Things You Buy for Kids
10. Honeymoon Spots
11. Computer Programs
12. Places to Hang Out
"""
list3 = """
1. Things You Make
2. Things at a Carnival
3. Spicy Foods
4. Things You Shouldn’t Touch
5. Foreign Words Used in English
6. Things You Do at Work
7. Things You Get Tickets For
8. Things Found in New York
9. Kinds of Soup
10. Trees
11. Things at a Football Game
12. Store Names
"""
list4 = """
1. Musical Groups
2. Types of Drinks
3. Cartoon Characters
4. Occupations
5. Things You Throw Away
6. States
7. Vegetables
8. Things at a Circus
9. Beers
10. Things That You Wear
11. Games
12. Movie Titles
"""
list5 = """
1. Items in a Vending Machine
2. Words Associated With Money
3. Diseases
4. Vacation Spots
5. Things Found in a Desk
6. Famous Duos and Trios
7. Things You Replace
8. Flowers
9. Items in a Kitchen
10. Methods of Transportation
11. Birds
12. Things You Shout
"""
list6 = """
1. Ethnic Foods
2. Parts of the Body
3. Song Titles
4. Sports
5. Words Associated With Exercise
6. Things That Are Round
7. Weapons
8. Halloween Costumes
9. Authors
10. Bodies of Water
11. Household Chores
12. Toys
"""
list7 = """
1. Things in a Medicine Cabinet
2. Fruits
3. Notorious People
4. Restaurants
5. Leisure Activities
6. Parks
7. Reptiles/Amphibians
8. Cooking Utensils
9. Celebrities
10. Cosmetics/Toiletries
11. Bad Habits
12. Spices/Herbs
"""
time.sleep(1.5)
list_number = [list1, list2, list3, list4, list5, list6]
list_choice = random.choice(list_number)
string.ascii_letters
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
print("Player 1's Turn.")
time.sleep(3)
letter = random.choice(string.ascii_letters)
print('Your letter is ' + letter)
time.sleep(1)
print('You will have 2 min to answer all of the questions.\nIf you do not answer the questions before the timer runs out,\nyour answers will not be saved.\nTo save your answer and move on to the next question\nyou must press enter.\nYou must answer the questions in chronological order.\nYour time will start in 10 seconds.')
time.sleep(10)
print(list_choice)
p1answers = []
count = 1
b = True #declare boolean so that code can be executed only if it is still True
t1 = time.time()
if playernum >= 1:
for i in range(0,12):
answer = [str(answer) for answer in input("Question " + str(count) ).split(",")]
t2 = time.time()
t = t2 - t1
if t > 120:
print("You have run out of time!")
b = False
break
if b == True:
p1answers.append(str(count) + ". " + str(answer))
count += 1
p2answers = []
count = 1
b = True #declare boolean so that code can be executed only if it is still True
t1 = time.time()
if playernum >= 2:
print("Player 2's Turn.")
time.sleep(3)
print('Your letter is ' + letter)
time.sleep(1)
print('You will have 3 min to answer all of the questions.\n If you do not answer the questions before the timer runs out,\n your answers will not be saved.\nTo save your answer and move on to the next question\nyou must press enter.\nYou must answer the questions in chronological order.\nYour time will start in 10 seconds.')
time.sleep(10)
print(list_choice)
for i in range(0,12):
answer = [str(answer) for answer in input("Question " + str(count) ).split(",")]
t2 = time.time()
t = t2 - t1
if t > 120:
print("You have run out of time!")
b = False
break
if b == True:
p2answers.append(str(count) + ". " + str(answer))
count += 1
p3answers = []
count = 1
b = True #declare boolean so that code can be executed only if it is still True
t1 = time.time()
if playernum >= 3:
print("Player 3's Turn.")
time.sleep(3)
print('Your letter is ' + letter)
time.sleep(1)
print('You will have 3 min to answer all of the questions.\n If you do not answer the questions before the timer runs out,\n your answers will not be saved.\nTo save your answer and move on to the next question\nyou must press enter.\nYou must answer the questions in chronological order.\nYour time will start in 10 seconds.')
time.sleep(10)
print(list_choice)
for i in range(0,12):
answer = [str(answer) for answer in input("Question " + str(count) ).split(",")]
t2 = time.time()
t = t2 - t1
if t > 120:
print("You have run out of time!")
b = False
break
if b == True:
p3answers.append(str(count) + ". " + str(answer))
count += 1
p4answers = []
count = 1
b = True #declare boolean so that code can be executed only if it is still True
t1 = time.time()
if playernum >= 4:
print("Player 4's Turn.")
time.sleep(3)
print('Your letter is ' + letter)
time.sleep(1)
print('You will have 3 min to answer all of the questions.\n If you do not answer the questions before the timer runs out,\n your answers will not be saved.\nTo save your answer and move on to the next question\nyou must press enter.\nYou must answer the questions in chronological order.\nYour time will start in 10 seconds.')
time.sleep(10)
print(list_choice)
for i in range(0,12):
answer = [str(answer) for answer in input("Question " + str(count) ).split(",")]
t2 = time.time()
t = t2 - t1
if t > 120:
print("You have run out of time!")
b = False
break
if b == True:
p4answers.append(str(count) + ". " + str(answer))
count += 1
print("Great job! It's now time to count the score.\nI will now print each players list and you can discuss the answers.\nIf you and another player obtained the same answer\nneither of you will earn a point.\nIf you produced a phrase that had multiple words\nstarting with the given letter then you get a point\nfor each word that began with that letter\nIf you belive that a word that another player entered\nshould not be scored you must disscus amongst you teammates")
time.sleep(5)
print(list_choice)
print("Bellow are player 1's answers:\n", p1answers)
if playernum >= 2:
print("Bellow are player 2's answers:\n", p2answers)
if playernum >= 3:
print("Bellow are player 3's answers:\n", p3answers)
if playernum >= 4:
print("Bellow are player 4's answers:\n", p4answers)
print("Enter each players score bellow.")
p1score = input("Player 1's score:")
if int(playernum) >= 2:
p2score = input("Player 2's score:")
else:
p2score = 0
if int(playernum) >= 3:
p3score = input("Player 3's score:")
else:
p3score = 0
if int(playernum) >= 4:
p4score = input("Player 4's score:")
else:
p4score = 0
while True:
if int(p1score) > int(p2score) and int(p1score) > int(p3score) and int(p1score) > int(p4score):
print("Player 1 Wins!")
break
if int(p2score) > int(p1score) and int(p2score) > int(p3score) and int(p2score) > int(p4score):
print("Player 2 Wins!")
break
if int(p3score) > int(p2score) and int(p3score) > int(p1score) and int(p3score) > int(p4score):
print("Player 3 Wins!")
break
if int(p4score) > int(p2score) and int(p4score) > int(p3score) and int(p4score) > int(p1score):
print("Player 1 Wins!")
break
if int(p1score) == int(p2score) and int(p1score) > int(p3score) and int(p1score) > int(p4score):
print("Player 1 and Player 2 Tied")
break
if int(p1score) == int(p3score) and int(p1score) > int(p2score) and int(p1score) > int(p4score):
print("Player 1 and Player 3 Tied")
break
if int(p1score) == int(p4score) and int(p1score) > int(p3score) and int(p1score) > int(p2score):
print("Player 1 and Player 4 Tied")
break
if int(p2score) == int(p3score) and int(p2score) > int(p1score) and int(p2score) > int(p4score):
print("Player 2 and Player 3 Tied")
break
if int(p2score) == int(p4score) and int(p2score) > int(p1score) and int(p2score) > int(p3score):
print("Player 2 and Player 4 Tied")
break
if int(p3score) == int(p4score)and int(p3score) > int(p1score) and int(p3score) > int(p2score):
print("Player 3 and Player 4 Tied")
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment