libeuler is a simple library you can include in your code to take away some of the boring repetitive parts of solving Project Euler problems.
-
Adds various methods to the Integer class, such as factorial, prime?, is_fibonacci?, etc.
-
Provides various module methods, such as generate_sieve, get_primes, etc.
require 'rubygems' require 'euler' 5.factorial # => 120
-
none
-
sudo gem install euler
-
Fork the project.
-
Make your feature addition or bug fix.
-
Add tests for it. This is important so I don’t break it in a future version unintentionally.
-
Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
-
Send me a pull request. Bonus points for topic branches.
Copyright © 2009 Mike Skalnik, Nick Kezhaya. See LICENSE for details.