Alternating between project Euler, a book (or two), back to project Euler for a bit is a very fast school, and you determine how fast you can pace yourself.
Alternating between project Euler, a book (or two), back to project Euler for a bit is a very fast school, and you determine how fast you can pace yourself.
Anyone else feel similarly?
Yes, a lot of the problems can be done by hand. You could treat the problems as "a math problem to solve", or as "an exercise in solving a problem with software."
When you've solved a problem, you have either "obtained the correct answer," or you have "figured out how to obtain the correct answer with software." Or both.
For me, even solving the early trivial ones, that could be done by hand, are more an exercise in software than in math.
Most of the time, I try to write my solutions in a general way, so that I can change the parameters of the problem, run it through software I've already written, and get the right results. The challenge then is defining the boundaries and parameters, and imagining the possible and reasonable limits of those boundaries and parameters. Just like we do every day with the rest of our software challenges.
The fact that these are math problems make it more fun for me, because I am not at all mathematically inclined. So I have to learn a little more math, and then decide if I've learned it sufficiently that my solution is reasonable.
Reading other people's posted solutions is almost as fun as solving the puzzle. I've learned a lot, or at least been impressed, from the various languages and hand solutions.
As for learning a new language, I think Euler is a reasonable tool in the total box. I find that I don't really know a new language until I've struggled with something "real" that matters, to me or my employer. And even then, if I come back to code a year or two later, I sometimes cringe, since I've likely learned more about using the language's strengths in that time, beyond just writing C in a new language.
Not to cheat using Google, but to discover the name of the branch of mathematics I had no clue about, and then to learn enough to keep going.
I still remember the afternoon I spent doing chromatic polynomials by hand, each graph I drew having more mental exclamations on the end, because I was goddamn getting it.
For me, the lift from earning a right answer is palpable.
https://projecteuler.net/problem=307
I couldn't solve it analytically for the life of me. So I wrote a small simulator, computed the answer to within 7 decimal places or so and then tried to figure out why that was the right answer. Then the lightbulb went on and I realized what the real answer should be and it worked.
As I wrote above, I am not very good at math, but to be able to use the computer to make your math understanding better than what it was before you started solving a problem was a huge up for me.
I'm currently trying to learn Rust, and since it's so new everything is geared towards people with experience. So I started Rust For Beginners:
http://www.rustforbeginners.com
I'm trying to make it a guide to the language, and programming in general, for true beginners. The very first post of actual coding (after installing, command line basics, and compiling/running with cargo) is a walk through of the first PE problem.
I know how you feel about most beginners guides not actually being suited for beginners. Since I'm a beginner, I'm hoping I'll be able to write one.
Feel free to check it out, and constructive criticism is encouraged!
The great thing about Project Euler for this is that the correct answer isn't a piece of code or an algorithm in some language, but just a number.
Project Euler does not really care how that number was derived. Using a mathematical formula, plain pencil and paper, a program in some language, or cheating via Google-fu? Euler doesn't care.
Because of this, it is very inviting to code a solution in a different language: 1) to learn that language, 2) to use a concept of the language with a better fit with the problem, 3) to see which language yields the quickest answer, measured in development time or actual run time.
The drawback of Project Euler is that it's quite addictive.