Skip to content

Commit

Permalink
feat : 백준 번호 순서로 정렬
Browse files Browse the repository at this point in the history
  • Loading branch information
wwan13 committed Apr 27, 2024
1 parent 56e2cb3 commit 1074d39
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions scripts/update_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,26 @@ def create_markdown_file():

index = 0

files = sorted(get_files_by_language("python") + get_files_by_language("java"))
files = get_files_by_language("python") + get_files_by_language("java")
ignored = ["python_summary", "SolutionSkeleton.java"]
for e in ignored:
files.remove(e)
files.sort(key=lambda x: int(get_solved_info(x)["problem_number"]))

for file in files:
if file.startswith("boj_") or file.startswith("Boj"):
index += 1
row_format = "| {} | {} | {} | {} | {} | {} |\n"
problem_number = get_solved_info(file)["problem_number"]
problem_info = get_problem_info(problem_number)

readme.write(row_format.format(
index,
problem_number,
problem_info["problem_name"],
"`{}`".format(problem_info["problem_level"]),
"`{}`".format(problem_info["problem_tag"]),
"`{}`".format(get_solved_info(file)["language"]),
))
index += 1
row_format = "| {} | {} | {} | {} | {} | {} |\n"
problem_number = get_solved_info(file)["problem_number"]
problem_info = get_problem_info(problem_number)

readme.write(row_format.format(
index,
problem_number,
problem_info["problem_name"],
"`{}`".format(problem_info["problem_level"]),
"`{}`".format(problem_info["problem_tag"]),
"`{}`".format(get_solved_info(file)["language"]),
))

readme.write("\n<br/>\n")
readme.write(time.strftime('%Y-%m-%d %H:%M:%S'))
Expand Down

0 comments on commit 1074d39

Please sign in to comment.