its 2025 and nobody actually writes their own documentation anymore xd i told ChatGPT what this thing does and it spat out the rest lmao if somethings wrong just pretend it isnt
fyi 100% of the actual raffle code was written by a human though (me)
-ryan
This repository contains the code used to run the official raffle for CALICO Spring 2025. It processes contest data, awards raffle tickets based on problem-solving performance, and draws winners reproducibly using a fixed random seed.
The raffle system works as follows:
- Load contest data (scoreboard, team info, raffle preferences, etc.) from the
data/directory. - Compute ticket counts based on each teamβs solves, ignoring disqualified or withdrawn teams.
- Generate tickets for individual contestants, based on team performance and submitted preferences.
- Run the raffle deterministically using a provided seed and prize inventory.
- Write results (including ticket counts and winners) to the
data/calico-sp25/processed/directory.
raffle-sp25/
βββ data/
β βββ calico-sp25/
β βββ raw/
β β βββ raffle_inventory.json
β β βββ raffle_seed.txt
β β βββ scoreboard.json
β β βββ teams.json
β βββ processed/
β βββ raffle_preferences_without_emails.json
β βββ raffle_ticket_counts.json
β βββ raffle_winners.txt
βββ scripts/
β βββ calico-sp25/
β βββ constants.py
β βββ raffle_public.py β main entry point
β βββ utils.py
β βββ __init__.py
βββ requirements.txt
βββ README.md
-
Install dependencies:
pip install -r requirements.txt
-
Run the raffle:
python scripts/calico-sp25/raffle_public.py
This will:
- Print progress and summary messages to the console.
- Write outputs to
data/calico-sp25/processed/raffle_ticket_counts.jsonandraffle_winners.txt.
-
Inspect results:
raffle_winners.txtβ human-readable winner list.raffle_ticket_counts.jsonβ ticket distribution by team.raffle_inventory.jsonβ remaining prize counts.
- Tickets: Each team gets 10 tickets for their first solve and 1 for each additional solve.
- Eligibility: Disqualified or withdrawn teams are excluded.
- Raffle logic: Randomized and reproducible β the same seed will yield the same results.
- Prizes: Assigned according to contestantsβ stated preferences, one win per contestant.
After running the script, youβll see a message like:
[INFO] Beginning raffle
[INFO] Ignoring 3 disqualified teams
[INFO] Created total 820 tickets
[INFO] Awarded 45 prizes
[INFO] Winners message saved to /data/.../raffle_winners.txt
Example snippet from raffle_winners.txt:
CALICOngratulations to the following CALICOntestants for winning the raffle!
1. **Jane Doe** from **Team Syntax Error** drew Logitech MX Master 3!
2. **Alex Kim** from **Team Overflow** drew Raspberry Pi 5!
The raffleβs random seed is exported directly from the #seed channel in the official CALICO Community Discord.
This ensures that the drawing process is transparent, verifiable, and reproducible β anyone with the same seed and data can reproduce the exact same set of winners.
The seed value is stored in:
data/calico-sp25/raw/raffle_seed.txt
and is automatically loaded by the raffle script at runtime.
- All paths and constants are centralized in
scripts/calico-sp25/constants.py. - Utility I/O functions (e.g., JSON/TXT loaders) are in
scripts/calico-sp25/utils.py. - To test changes, modify the data files under
data/calico-sp25/raw/and rerun the script.