-
Notifications
You must be signed in to change notification settings - Fork 0
/
polyhash.py
executable file
·37 lines (27 loc) · 1.09 KB
/
polyhash.py
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Module principal pour la mise en oeuvre du projet Poly#.
"""
def main():
from polyparser import parse_challenge
from polysolver import solve, save_solution
import visualizer
import argparse
parser = argparse.ArgumentParser(description='Solve Poly# challenge.')
parser.add_argument('challenge', type=str,
help='challenge definition filename',
metavar="challenge.txt")
parser.add_argument('output', type=str, default=None,
help='output filename',
metavar="sortie.txt")
args = parser.parse_args()
challenge_data = parse_challenge(args.challenge)
# visualizer.simple_summary(*challenge_data)
solution = solve(challenge_data, solve_strategy=3)
if args.output is not None:
# Sauvegarder le fichier généré
save_solution(args.output, solution)
print(f"Solution saved in {args.output}")
if __name__ == "__main__":
main()
# use : python polyhash.py challenges\a_example.in output\out.txt