From 231deba8ed715fc2a52f6396459cb9fd4124b64c Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Mon, 13 Mar 2017 00:50:22 -0500 Subject: [PATCH] Count total points. --- count.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/count.py b/count.py index efaa215..5320593 100644 --- a/count.py +++ b/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