we get signal

2009-03-14

Discrete Math Achievements: Project Euler

(tags programming, Ruby, Project Euler)

I sure need to put these type of posts into my programming blog, but obviously I don't have one at the moment. Still check it, programming Achievements. A whole lot cheeper than DLC.

Project Euler, or You put Achievements in my Programming

Project Euler is a programming site that revolves around posing discrete math problems like finding the sum of all the prime numbers below two million (problem 10). You create an account for free, you fill in your attempted answer, and if you get the answer right, you get a green icon and access to the discussion forums on that problem. I think the best part is it shows your status in Xbox Live-like Achievement icons and also it shows how many people have solved the same problem. Plus the guarantee that the problems are posed such that you will be able to solve them in 60 seconds execution time using a modern computer gives me instant feedback.

I still have some work to finish just to shrug off my newbie status, eg. to reach first level rank I need to solve 25. The problems aren't too hard, though I am concerned that I am using I am brute forcing a lot using Ruby. Yes Ruby. Using Ruby feels natural to me, because the flow of thinking, typing, and running is uninterrupted (using the REPL inside Emacs is just golden). I am also trying to solve the problems in C++ (it's not that bad) and Clojure (actually haven't started yet). But first I explore using Ruby.

And here I am thinking I should be trying out Python because it has better multi-platform support (Windows is a first-class citizen), execution speed faster than Ruby, and I don't have a problem with whitespace as syntax. While I'm at it, I should just try on JavaScript and Common Lisp versions as well. Or go crazy and try to do it in AutoHotKey, Visual Basic 6 (this one pays money, I'm sad to say), Windows Command Shell, or even Gnu Bash. Yeah right.

These aren't really "push-ups" for regular programmers though, because I think they are far removed from regular application programming, which is just pretty much pushing data from one place to another. Plus I'm pretty sure there are no compiler questions, given that Euler manning the post. But I think it's great practice for thinking about efficiency vs premature optimization (at the design and execution level, etc).

Labels: , ,