From 7c74fea7743ff622d9549c4b2b15fa9bf3319f98 Mon Sep 17 00:00:00 2001
From: Adam Blank <blank@caltech.edu>
Date: Sat, 5 Oct 2024 18:26:44 +0000
Subject: [PATCH] Add new file

---
 02/game.py | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 02/game.py

diff --git a/02/game.py b/02/game.py
new file mode 100644
index 0000000..c416c79
--- /dev/null
+++ b/02/game.py
@@ -0,0 +1,50 @@
+from util import play
+import time
+from scripts import GO_TO_SLEEP_SCRIPT, role_script, close_eyes_script, WAKE_UP_SCRIPT
+
+WAKING_ROLES = ['werewolves', 'minion', 'masons', 'seer',
+                'robber', 'troublemaker', 'drunk', 'insomniac']
+NON_WAKING_ROLES = ['villager', 'hunter', 'tanner']
+
+ALL_ROLES = WAKING_ROLES + NON_WAKING_ROLES
+
+
+def check_roles(some_roles):
+    return False
+
+
+def is_valid_game(some_roles):
+    """
+    This function checks if the provided list of roles can make
+    a valid game of one-night werewolf. To be valid, a role list
+    must consist of only valid roles (Those in the `ALL_ROLES`
+    list) and the role list must contain "werewolves".
+
+    Args:
+        some_roles (list[str]): A proposed list of roles for a one-
+            night werewolf game.
+
+    Returns:
+        bool: `True` when `some_roles` represents a valid game of 
+            one-night werewolf and `False` otherwise.
+    """
+    return False
+
+
+def announcer(roles):
+    """
+    Generates a script for the announcer in a one-night werewolf
+    game and plays it out loud on the computer's speakers.
+    If the list of `roles` is invalid, the entire script should 
+    consist of "That's not a valid set of roles!".  Otherwise,
+    the announcer plays the `GO_TO_SLEEP_SCRIPT`. Then,
+    for each **waking** role, the announcer (0) plays the script 
+    for that role, (1) waits for one second, and (2) prints the 
+    "close_eyes_script" for that role.  After playing every 
+    role's script, the announcer plays the `WAKE_UP_SCRIPT`.
+
+    Args:
+        roles (list[str]): A proposed list of roles for a one-night
+            werewolf game.
+    """
+    pass
-- 
GitLab