The QuickCal winners

We had a record number of entries on the QuickCal drawing. I had to update my scripts a little to handle the larger-than-expected numbers, more on that after the good part.

Without further ado, here’s the list of lucky winners. If you didn’t receive your code or have any trouble redeeming it, don’t hesitate to contact me.

The winners!

Sorry for any confusion caused by the errant post about 10 minutes ago. I got a test run confused with the final output from the script. My bad, sorry.

Congratulations! The names are linked to the original comment so you can check and make sure it was you. Or not you, if luck was not on your side.

Script update

As far as the scripts go, I found a much, much better algorithm for collecting a set number of unique random integers from a given range:

max = entries.length - 1
count = codes.length - 1
randoms = (0..max).to_a.sort{ rand() -0.5 }[0..count]

No recursion, so it’s about exponentially faster (and doesn’t run into stack depth errors). I also modified the script to output a Markdown list of the winners with the url of their comments so there’s no question when people have the same first name and don’t enter a last name.

Brett Terpstra

Brett is a writer and developer living in Minnesota, USA. You can follow him as ttscoff on Twitter, GitHub, and Mastodon. Keep up with this blog by subscribing in your favorite news reader.

This content is supported by readers like you.

Join the conversation