feat: First version of the script

This commit is contained in:
2025-12-10 01:32:41 +03:00
parent 4375b8e8fe
commit 4f6ee2a4a7
3 changed files with 110 additions and 2 deletions

View File

@ -1,3 +1,51 @@
# secret-santa
### Secret Santa
Simple `python3` script for the "Secret Santa" game. Creates participants pairs from input json file and prints and saves them to the output json file.
This small script might evolve into a simple website, API or `bash` script in the future!
"Secret Santa" game python script. Might evolve into simple website, API or bash script.
### Run:
- Create `participants.json` file as in the example
- Run the next command in your shell (from the same directory as the `main.py` file):
```sh
python3 main.py
```
- Enjoy script results!
### Examples:
- Input file (`participants.json`):
```json
[
"Jayce",
"Viktor",
"Jinx",
"Vi",
"Ekko",
"Caitlyn"
]
```
- Output file (`pairs.json`):
```json
{
"Jayce": "Vi",
"Vi": "Viktor",
"Viktor": "Caitlyn",
"Caitlyn": "Jinx",
"Jinx": "Ekko",
"Ekko": "Jayce"
}
```
- Console output:
```
Reading from participants.json.
Writing to pairs.json.
Finished!
Results:
Jayce → Vi
Vi → Viktor
Viktor → Caitlyn
Caitlyn → Jinx
Jinx → Ekko
Ekko → Jayce
```