Count total points.
This commit is contained in:
parent
5a1764b856
commit
231deba8ed
1 changed files with 4 additions and 0 deletions
4
count.py
4
count.py
|
@ -9,6 +9,7 @@ problem_names = os.listdir(os.path.dirname(os.path.abspath(__file__)))
|
|||
problems = []
|
||||
|
||||
failed = []
|
||||
total = 0
|
||||
|
||||
for problem_name in problem_names:
|
||||
folder = os.path.dirname(os.path.abspath(__file__)) + os.sep + problem_name
|
||||
|
@ -36,8 +37,11 @@ for category, count in categories:
|
|||
print(" %s: %s" % (category, count))
|
||||
for problem in problems:
|
||||
if problem.get("category") != category: continue
|
||||
total += int(problem.get("value"))
|
||||
print(" %s %s %sp" % (problem.get("title") + " " * (maxtitle - len(problem.get("title"))), problem.get("author") + " " * (maxauthor - len(problem.get("author"))), problem.get("value")))
|
||||
|
||||
print ("\nTOTAL VALUE: %d" % total)
|
||||
|
||||
print("\nThe following problems failed to parse.")
|
||||
for title in failed:
|
||||
if title in [".git"]: continue
|
||||
|
|
Loading…
Reference in a new issue