Monday, September 20, 2010

Project Euler 002

Hey, glad I got some followers.  This is my response to the second one (check the link in the title of the post for the prompt).  I recommend Project Euler as a way of jumping into Ruby, especially if you love Math.


#Project Euler
#Problem 2

a, b, sum = 1,2,0

while b < 4000000
  sum += b if b.even?
  a,b = b,a+b
end
puts sum

17 comments:

  1. I know nothing about programming, but I find it interesting... Never clicked with me though.

    ReplyDelete
  2. Ruby seems a bit cluge.. I see what you're doing, but the syntax is shot :P

    ReplyDelete
  3. I am an avid programmer, with experience in Ruby. I much prefer more structured langauges, however, such as C#. Certainly there are reasons to enjoy the flexibility of Ruby but it can also be a frustration.

    ReplyDelete
  4. I also like this. Keep them coming!

    ReplyDelete
  5. Sounds good. Project Euler is a great way to sharpen your skills with any cs language really.

    ReplyDelete
  6. This remember a lot of day in school -_-'

    ReplyDelete
  7. Wish I was more of a programmer but did some research and it seems interesting

    ReplyDelete
  8. I did a bit of programming while I was at school before I got into photography I liked it.

    ReplyDelete
  9. This comment has been removed by the author.

    ReplyDelete
  10. What is this I don't even.


    Twitter.com/CawlinForReal

    ReplyDelete
  11. Look forward to your next update! :D I'll keep in touch.

    ReplyDelete