Prime in Ruby – alternative solution
Contact me at LinkedIn  RailsZilla at Facebook  RailsZilla at twitter   google +1  Contact me at Xing  connect me at github

Prime in Ruby – alternative solution

Posted in Ruby

As I showed in my article here, we can have another way of doing this job: 1234567require ‘prime’ goal = 600851475143 Prime.each(goal) do |number|    @container = [number] end puts @container.last This small piece of code illustrates togeter with my other solutions, that we have a vast amount of ways doing things in Ruby …

Tags: , , ,

Project Euler – problem 2 in Ruby

Posted in coffee break, Ruby

Hi folks, this is part two of our soultions-series for the mathematical problems in Project Euler. Project Euler – problem number two: “Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, […]

Tags: , , , , , ,

Copyright © 2011-2017  - RailsZilla – Ruby on Rails tutorials, tips and tricks All rights reserved. | Imprint | Privacy