I’ve added a new site to my daily workflow. Project Euler. Each day I complete one or two problems first thing in the morning when I get to work to give my brain a kick start for the day. Naturally I use Dart as my language of choice for the problems.
For those of you unfamiliar with the site, basically there are (currently) 468 different programming challenges/problems. You can choose to complete them in any order. You can use any programming language of your choice to derive the solution. Once you’ve arrived at your solution, you simply submit the answer to find out if it is correct or not.
Once you’ve correctly answered a problem, you will be able to access a discussion forum related to that problem (the forum usually consists of individuals discussing how they completed the problem or solutions in various programming languages). Additionally a PDF overview of the problem is provided which will usually discuss how to complete the problem in both the straight-forward manner with a basic algorithm and a second more detailed look at how it can be accomplished with various mathematical formulas.
In the spirit of the site, I won’t post any of my answers. But the site is a lot of fun to get the brain working. Usually I’ll first complete a very basic algorithm which will produce the result, and then I will do research or even just study my code to see how I can make it much more efficient.
One thing to note, is that on any relatively recent computer, the program to generate the solution should not take more than a minute or so. If you find your solution is taking a very long time to be calculated, there’s a good chance that it has a far from optimal solution and you should review your code. This has only once been an issue for me thus far.
If you’re interested in adding me as a friend on the site, my key is: