Skip to content

Obsess much…?

I have been told I am incapable of maintaining even a bad habit. The implication being the outlook for GOOD habits is more than just a bit bleak.

That being said, Project Euler (https://projecteuler.net/) has my attention!

I stumbled upon it while looking into various code challenge sites. Leet Code (https://leetcode.com/) being one of the most well known, I wanted to find others. I was particularly interested in finding sites that supported Perl. I’m interested in C# as well, but I am still learning C#. I also have a Love/Hate relationship with JavaScript. The last two are pretty universally supported at these code challenge sites but Perl, less so. So when I saw that Project Euler “supported” Perl, I had to look.

Project Euler, named after the pivotal Swiss mathematician Leonhard Euler, in its own words “exists to encourage, challenge, and develop the skills and enjoyment of anyone with an interest in the fascinating world of mathematics.” It contains over 870 problems designed to be solved through some sort of computation.

Unlike other code challenge sites, Project Euler does not actually come with a coding platform. You code on your own computer. So you can, in fact, post solutions in any language. Including that most quirky of programming languages, “paper and pencil.” The language “support” comes in the form syntax highlighting for the code you post. So you really can post in any language whatsoever, and trust me, there some seriously obscure languages used!

One of the interesting cultural quirks of Project Euler is the emphasis on self-learning (aka, the hard way) as opposed to just looking it up. So the forums for each problem are locked until you solve the problem. Furthermore, the site requests you specifically not publish your solutions outside of the forums. In many cases (especially with me) that means solving the problem in some highly inefficient, brute force manner, then logging into the forum to read about the much more elegant solutions used by others. You will also find those who post massively optimized solutions that run in ridiculously short times (especially those special kind of crazy Assembler folks). You will also find the mathematical “short cuts.”

In short, if you have the time, the real learning comes after completing the challenge. In something of a Harry Potter sort of test, you don’t get to participate in the class, until you craft your own key to the door. Perhaps that’s what makes it so obsessive.

As it is, I have already created some personal milestones, some of which I’ve already achieved.

  • Do at least one problem (complete). Sounds lame I know, but being honest, these kind of problems are not the sort of thing I am usually good at. Until I completed one, I wasn’t sure this site would be for me.
  • First Digi-badge (complete). Like many sites, there is a gamification component. The site has levels and awards for different actions. “Baby Steps” is the digi-badge for completing any three problems. My second was “Decathlete” for completing any ten consecutive problems.
  • Level 1 (complete). There are currently over 870 problems with new ones being posted all the time. Every 25 problems solved advances you one level.
  • Level 4. Level 4 equates to having solved 100 problems. If done consecutively, starting at 1 this means completing what the site refers to as “the Easy” problems. Note ,that does not mean they actually all are easy. Many have a difficulty rating as high as 40%. Even some of the easy ones may take quite a bit of thought. Even with the 5% difficulty ones I have done so far, some I solved in mere minutes, others took a couple days to think through.
  • Attain Level 16. At this time, there are approximately 70,000 people who have attained Level 1. However, Level 16 is still less than 100. Besides being a really small group, that means if I make a post, it will remain permanently! How cool is that?
  • Re-Solve Some/All. As I said, the solution that gets you in the door, is not the only one. You can [usually] use brute force (my current, first stop). You can try to optimize your run time. You can solve it purely mathematically. Some even golf their code and use as few characters as possible. And of course, you can explore new, even intensely obscure languages.

As I mentioned, brute force has been my goto method so far. A couple times I recognized a pattern I could exploit to shorten the process. But it is very possible I am going to have to get my learn on to solve later problems. I even bought two books to help me out.

Elements of Algebra, Leonhard Euler
The Elements, Euclid

That’s right. I’m calling in the big guns. “Elements of Algebra” by the man himself, Leonhard Euler and “Elements” by the Greek Philosopher and “Father of Geometry”, Euclid. I’m going to solve these things, even if I have to think!

Published inMusingsTechTalk

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Obsess much…?

by Robert time to read: 3 min
0