Created
September 22, 2025 13:30
-
-
Save venetanji/dae1dc1d75568e6f32ad78c0aacd6f25 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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