Skip to content

Commit

Permalink
Prettify even more
Browse files Browse the repository at this point in the history
  • Loading branch information
Morganamilo committed Dec 2, 2018
1 parent b1c9a1e commit 68374e2
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions plugins/adventofcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,27 @@

table = "\nCurrent Advent of Code 2018 ranking:\n"

for member in sorted(members.values(), key=lambda k: k['local_score'], reverse=True):
table += '{0:<22} {1:>5}\n'.format(member['name'], member['local_score'])
table += '{0:3} {1:4} {2:25} {3}\n'.format("", "", " 1111111111122222", "")
table += '{0:3} {1:4} {2:25} {3}\n'.format("", "", "123456890123456789012345", "")


for position, member in enumerate(sorted(members.values(), key=lambda k: k['local_score'], reverse=True)):
stars = ""
for n in range(1,25):
days = member['completion_day_level']
if str(n) in days and days[str(n)]:
if "2" in days[str(n)]:
stars += '*'
else:
stars += '-'
else:
stars += ' '

table += '{0:3}) {1:4} {2:25} {3}\n'.format(
position + 1,
member['local_score'],
stars,
member['name'],
)

print("```{}```".format(table))

0 comments on commit 68374e2

Please sign in to comment.