Coding Contest Template Script
Template script for coding contest designed to be reused for each different level.
Usage
-
Modify the variables
INPUT_FILES_FOLDER
andOUTPUT_FILES_FOLDER
to match your desired input and output file patterns. -
Implement your logic to solve the level under levels/lvlX.py. The function
main(input:str)
is the entry point for the script. You have to add the function and modify the function to implement your own processing logic. -
Put the files that have to be processed in the directory specified by the
INPUT_FILES_FOLDER
variable. -
Run the script
python main.py --lvl X
where
X
is the level number. The script will process all files that match theINPUT_FILES_FOLDER
variable and write the output to the files that match theOUTPUT_FILES_FOLDER
variable.
Configuration
The following variables can be modified to configure the script:
INPUT_FILES_FOLDER
: This variable sets the filename pattern for the input files. By default, it is set to'input/*.in'
, which matches all files with the.in
extension in theinput/
directory. You can modify this variable to match a different filename pattern or directory structure.OUTPUT_FILES_FOLDER
: This variable sets the filename pattern for the output files. By default, it is set to'output/*.out'
, which creates output files with the.out
extension in theoutput/
directory. You can modify this variable to change the filename pattern or output directory.
The following parts MUST be configured:
- 'levels/lvlX.py' -
def main(input:str)
function - This function is the entry point for the script. You have to add the function and modify the function to implement your own processing logic.