Unnamed Fossil Project

Check-in [7a8cea529e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:asdf
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA1:7a8cea529e2057d38b2760bcc943ae65ac05b769
User & Date: areichow 2012-03-08 18:00:35
Context
2012-03-08
18:00
asdf Leaf check-in: 7a8cea529e user: areichow tags: trunk
17:52
initial empty check-in check-in: a2dbeec879 user: rev tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added fib.rb.









































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
fibn = 45

def fib(a)
  if a < 2
    a
  else
    fib(a - 1) + fib(a - 2)
  end
end

def bench(n, fibn)
  n.times do
    time_start = Time.now
    puts "fib(#{fibn}): #{fib(fibn)}\nTotal time: #{Time.now - time_start}"
  end
end

# bench(5, fibn)

puts fib(30)