Project Euler

Today I started working on the pre-work track to stay current with all that I've learned so far. My cohort doesn't begin until November 2nd so I definitely think it's a good idea! The pre-work is optional, and it consists of problems borrowed from a website called Project Euler

"Project Euler exists to encourage, challenge, and develop the skills and enjoyment of anyone with an interest in the fascinating world of mathematics."

eekk, they said the "m" word! MATH! Is the "enjoyment" of math really a thing? 

Personally, I would've never described math to be "fascinating" or "interesting", so I am definitely a bit nervous about this track. I'm hoping the love of math isn't a requirement for being a good programmer... but maybe I'll learn to appreciate it? heh... Actually, I'm already really stuck on problem 3 hence why I'm taking a break to write this blog post! :) But so far I have been able to solve problems 1 and 2, definitely with the help of Learn's tests/error codes leading the way! Yes, we are making friends with error codes! 

What's neat about Project Euler is that there are TONS of problems, and it's all-inclusive by the way they're written.  For example, it doesn't specify how you SHOULD or even could solve the problem. Since I'm learning Ruby though, obviously that's the route I'm taking! 

"Problem 1

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000."

Go on now! Give it a try! CLICK HERE if you are interested in seeing my solution(s)! The first way is solved procedurally, then you'll see a refactored version using object orientation. I'm sure there's still a better way to simplify it, and/or solve it. I would actually love to see your solutions! Link them in the comments below!

What helped me was starting with a pen and paper and pseudocode. Oh, IRB and google helped too! ¡Buena suerte!