# One value. Many cases.
# match / case — cleaner alternative to long if / elif chains

import random

# ─────────────────────────────────────────────
# Basic match / case
# ─────────────────────────────────────────────

command = input("Enter command: ")

match command:
    case "quit":
        print("Quitting.")
    case "help":
        print("Showing help.")
    case "start":
        print("Starting.")
    case "pause":
        print("Pausing.")
    case _:
        print("Unknown command.")

# case _ is the wildcard — catches everything that didn't match

# ─────────────────────────────────────────────
# Matching numbers
# ─────────────────────────────────────────────

roll = random.randint(1, 6)

match roll:
    case 1:
        print("One — try again.")
    case 6:
        print("Six — you win!")
    case _:
        print(f"Rolled {roll} — keep going.")

# ─────────────────────────────────────────────
# Multiple values in one case — |
# ─────────────────────────────────────────────

day = input("Enter a day: ").lower()

match day:
    case "saturday" | "sunday":
        print("Weekend.")
    case "monday" | "tuesday" | "wednesday" | "thursday" | "friday":
        print("Weekday.")
    case _:
        print("Not a valid day.")

# | combines multiple values in a single case

# ─────────────────────────────────────────────
# Quick reference
# ─────────────────────────────────────────────

# match value:          — one variable, checked once
#     case option_1:    — runs if value == option_1
#         block
#     case option_2:    — runs if value == option_2
#         block
#     case _:           — wildcard, catches everything else
#         block
#
# available from Python 3.10+
# case _ always goes last
# | combines multiple values in one case
# first match wins — no break needed
