-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f15615b
commit 47adf62
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Problem Generation | ||
|
||
This directory contains problem generators, which is in charge of generating | ||
problem inputs and their solutions. The de facto language for problem | ||
generators is Python. | ||
|
||
For an example of a problem generator, see [./01/problem.py](./01/problem.py). | ||
|
||
## Specification | ||
|
||
The server expects a problem generator to implement the following usages: | ||
|
||
- `$PROGRAM --seed $SEED`: generate a problem input using the given seed. | ||
- `$PROGRAM --seed $SEED --part1`: generate the part 1 solution using the given seed. | ||
- `$PROGRAM --seed $SEED --part2`: generate the part 2 solution using the given seed. | ||
|
||
Currently, only Python is supported as the language for problem generators. | ||
It would be trivial to support other languages, but it is not a priority at the | ||
moment. | ||
|
||
## Python | ||
|
||
Python problem generators must have a module path of `problems.NAME.problem`. | ||
For example, if the problem name is `01`, the module path must be | ||
`problems.01.problem`. | ||
|
||
To test this, simply run the following command: | ||
|
||
```sh | ||
python -m problems.01.problem --seed 0 | ||
``` |