$ cat posts/and-the-winner-is.md
And the winner is ...
The two weeks I gave to solve the Programmers' Day challenge are up. Seven contestants entered:
- Daniel Martinez @edmt with a solution in Ruby.
- Pedro Guerrero @pedroguerrero with his solution in Python.
- Jano González @janogonzalez with another solution in Ruby.
- Mario Fuentes @mariofuentes with a solution in Go.
- Dardo de Leon @dardodeleon with a solution in PHP.
- Christian @christiaclx with another solution in Python.
- Javier Novoa @jstitch with another solution in Python.
OK, on to the evaluation.
Phase 1: Execution.
Each program is run with the following parameters: 1000, 2000, 2002, 2004, 2009, 2014, 2015, 2022.
Results:
- @edmt: the answers for 2002 and 2004 were incorrect in the sense that they only reply: “Здравствуйте”, which, if my Russian isn’t off (i.e. Google Translate), means “Hello”. So in this phase @edmt does not pass.
- @pedroguerrero: this program’s answers in Russian are also fixed and say something like: “Он по-прежнему отмечается программист”, which according to Google Translate means “He still says Programmer”. (?). However, this solution is interesting because it doesn’t use any library functions to calculate the day of the week; instead it applies the famous Zeller’s congruence to calculate the day of the year. Nicely done, Pedro!
- @janogonzalez: has the same problem with the answers in Russian.
- @mariofuentes: his program answers correctly in Russian, or at least it seems to :). For example, when given 2002 as a parameter the answer is: “День разработчика” 2002 “состоялось в Пятница, 13 Сентябрь”, which according to Google Translate means “Developer Day 2002 held on Friday, September 13”.
- @dardodeleon: the problem with this solution is that it requires Vagrant. I tried to run it directly but apparently I have to configure php.ini. Even though it is well documented, the time window I set aside to evaluate this challenge doesn’t let me keep digging on my Mac (I have Vagrant installed, but only as a side effect of installing Docker, and I don’t know Vagrant well enough to get the program running).
- @cristhianclx: his program answers correctly in Russian, the same way @mariofuentes’s program does.
- @javistitch: His Python 3 solution is the most ambitious because it tries to translate the text online using Google Translate’s services. An interesting idea, but unfortunately I couldn’t get it to run on my Mac. Even though I have Python 3, I had trouble installing GoSlate and, just as with @dardodeleon, the time window I set aside for the evaluation doesn’t let me keep digging.
Phase 2: Program length
This is the number of lines of code in each program:
@christianclx’s solution has 24 effective lines of code versus @mariofuentes’s 39 lines of code.
So we have a winner, and it’s @christianclx. Congratulations!
Over the next few days I’ll get in touch with you to work out how to get you the prize.
Thanks to everyone for taking part!
Comments
comments powered by Disqus