Coder Profile - Show off your skills, get a coder profile.
 
 
 
code pin board Fib Seq in Ruby Download Source Code
Author Details Code Information
Damner ( Dominik )

Pinned 4 Codes
Posted 1 Coding Articles

Send A Message
View Coders Profile
Language Ruby
Expires Never
Length 323 Characters (18 Lines)
Password no password
Description

Something I did for practice. :) Rubys fun.
  1. #fib.rb
  2. #Testing my ruby skills, basically a Fibonnaci sequence genetator in ruby, with a built in tester.
  3.  
  4. #sequence generator
  5.  
  6. def fib(n)
  7.   return n if (0..1).include? n
  8.   fib(n-1) + fib(n-2)
  9. end
  10.  
  11. #tester
  12.  
  13. puts "To which nth do you want to display "
  14. n = gets.chomp.to_i
  15.  
  16. n.times do |i|
  17.        puts fib(i+1)
  18. end
code pin board Back To Code Pin Board Post New Code
Please login to post comments.
Page 1 of 1
 
 
Latest News About Coder Profile
Coder Profile Poll
Why do you get bored with programming?

Not enough time to do something productive
I run out of ideas
Too hard to show people my creations
Everything i do has too many errors, and it's too hard
I don't get bored!!!


please login to cast your vote
and see the results of this poll
Latest Coder Profile Changes
Coder Profile was last updated
1.67 Year Ago
Official Blog :: Make A Donation :: Credits :: Contact Me
Terms & Conditions :: Privacy Policy :: Documents :: Wallpapers
Version 1.46.00
Copyright © 2007 - 2010, Scott Thompson, All Rights Reserved