Skip to content

Instantly share code, notes, and snippets.

@venetanji
Created September 22, 2025 13:30
Show Gist options
  • Save venetanji/dae1dc1d75568e6f32ad78c0aacd6f25 to your computer and use it in GitHub Desktop.
Save venetanji/dae1dc1d75568e6f32ad78c0aacd6f25 to your computer and use it in GitHub Desktop.
# PolyU Bad Weather Arrangements: The Pseudocode Adventure!
def polyu_bad_weather(signal, time_lowered_or_cancelled):
"""
signal: "T8" (Typhoon Signal No. 8 or higher), "RED", "BLACK", "EXTREME"
time_lowered_or_cancelled: time (in 24hr, e.g., 6.30, 10.45, 12.00)
"""
# During these signals, campus is a ghost town!
if signal in ["T8", "RED", "BLACK", "EXTREME"]:
print("🚨 All classes and exams are SUSPENDED!")
print("Stay safe and watch the weather updates. β˜”οΈπŸŒ€")
# When the signal is lowered or cancelled, check the time!
if time_lowered_or_cancelled < 7.0:
print("Signal is gone before 7:00 β†’ Classes/Exams resume as normal. Set your alarm! ⏰")
elif 7.0 <= time_lowered_or_cancelled <= 11.0:
print("Signal is gone between 7:00 and 11:00 β†’ Classes/Exams restart 2 hours later.")
print("Use the time to review or nap! 😴")
elif time_lowered_or_cancelled > 11.0:
print("Signal is gone after 11:00 β†’ No more classes/exams today. Enjoy your free day! πŸŽ‰")
else:
print("Wait for official PolyU announcements for more details.")
else:
print("No bad weather signal. School as usual! See you in class! πŸ“š")
# Example adventures
print("== Scenario 1: Typhoon Signal lowered at 6:30 ==")
polyu_bad_weather("T8", 6.30)
print("\n== Scenario 2: Black Rainstorm cancelled at 10:15 ==")
polyu_bad_weather("BLACK", 10.15)
print("\n== Scenario 3: Extreme Conditions cancelled at 12:00 ==")
polyu_bad_weather("EXTREME", 12.00)
print("\n== Scenario 4: No warning ==")
polyu_bad_weather("NONE", 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment