feat: First version of the script
This commit is contained in:
52
README.md
52
README.md
@ -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
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user