Grid Chart for Toph's One Million Submissions
Toph recently reached a milestone my family and I have been looking forward to. One million submissions. It may be a small win, but it is that sweet reward of working on your favourite project.
On the relevant Toph Blog post, we have a picture that is 3840×25982 pixels and has one million coloured squares on it. The squares represent the one million submissions and are green for correct (Accepted) submissions and red for any other incorrect (Wrong Answer, CPU Limit Exceeded, etc.) submissions.
So how was the image generated?
First, I took a CSV export of the one million submissions. In the export, I included the Verdict column; that’s what we need.
Next, I wrote a small Go program that looped over this list of verdicts, drawing squares from left to right, top to bottom. Error handling has been omitted from the snippet below for brevity.
I added some flags to the command to make it easy to toy around with the image’s dimensions and the size of the dots.
It is no Monalisa, but hey, it looks neat. Although it reminds me of the disk defragmentation utility from the Windows 9x era.
I am sharing the Go code and the list of one million verdicts in this GitHub repository: hjr265/toph-million.
This post is 3rd of my #100DaysToOffload challenge. Want to get involved? Find out more at 100daystooffload.com.
comments powered by Disqus