-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreate_Script.py
More file actions
40 lines (31 loc) · 1000 Bytes
/
Create_Script.py
File metadata and controls
40 lines (31 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from pathlib import Path
from challenge_utils import ScriptBuilder
# Constants
PROBLEM_NO = 17
CHALLENGE = 3
CHOSEN_LANGUAGE = "rust"
AUTHOR = "Abbas Moosajee"
CONFIG_DICT = {
3 : ("set_03", "cryptopals_set_03.json"),
# 4 : ("set_04", "cryptopals_set_04.json"),
# 5 : ("set_05", "cryptopals_set_05.json"),
# 6 : ("set_06", "cryptopals_set_06.json"),
# 7 : ("set_07", "cryptopals_set_07.json"),
# 8 : ("set_08", "cryptopals_set_08.json"),
}
def main() -> None:
"""Main function to create challenge files."""
repo_dir = Path(__file__).parent
folder, config_file = CONFIG_DICT[CHALLENGE]
challenge_dir = repo_dir / folder
try:
builder = ScriptBuilder(AUTHOR, challenge_dir, config_file)
filepath = builder.create_files(
prob_no=PROBLEM_NO,
language=CHOSEN_LANGUAGE,
txt_files=1,
)
except Exception as e:
print(f"An error occurred: {e}")
if __name__ == "__main__":
main()