About a year or so ago, I was told of this site, Project Euler. Unfortunately I didn’t get into it back then, but an email from a mailing list that I’m apart of re-sparked my interest in it. In case you haven’t heard of it before, here is the description of it from the site:
Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems.
The motivation for starting Project Euler, and its continuation, is to provide a platform for the inquiring mind to delve into unfamiliar areas and learn new concepts in a fun and recreational context.
Fantastic! It’s like being back in Dr. Dorin’s Data Structures and Algorithms class back at Loyola Marymount. A problem is presented to you. You use math and software development to find an answer. Check your answer on the site. You can register and it keeps track of which problems you’ve finished and which you haven’t.
But that’s only half the fun. If you continue reading on Project Euler’s About Page,which I highly recommend reading to get you more excited about this:
I’ve written my program but should it take days to get to the answer?
Absolutely not! Each problem has been designed according to a “one-minute rule”, which means that although it may take several hours to design a successful algorithm with more difficult problems, an efficient implementation will allow a solution to be obtained on a modestly powered computer in less than one minute.
Not only can you solve problems, but you can then optimize the solution! Yes, you could optimize in almost any situation, however in problems presented at Project Euler, you know the rough time frame that your answer should be found in. You may write an algorithm that gets the right answer, but requires 6 hours to complete, but 6 hours is much greater than 1 minute. What do you do now? You can go to the next problem and start working on it, or you can go back into your code and see what can be fixed up and optimized. Try to hit that one minute mark. If you have, can you make it any faster? This would be a good way to learn how to gauge your code. See where it can bog down and how to avoid that situations. The learning potential here is grand.
So this seems to be exactly what I originally envisioned this blog being about: code posting, something I’ve really not done outside of a few situations. As I plow through these Project Euler problems, I hope to post the resulting code any any explanations to my blog. Hopefully that isn’t a problem from the people that run the site. If it is, please email me!
Once I start, I will try to post 1 solution a week until, well, they get too hard to post once a week given my free time. Unknown currently is whether I want to use a language that I’m comfortable in, like Java or C, or try to pick up a new language in this process, like Python. I’m learning more toward the Python route. Then, hopefully, all your Pythoneers (?) can tell me what I’m doing wrong.