5 kyu
Fibonacci Generator
906 of 920x-way
Description:
Create a function generator genfib() that returns a function fib() which always returns the next fibonacci number on each invocation (and returns 0 when being called the first time).
Example:
var fib = genfib();
fib(); // -> returns 0
fib(); // -> returns 1
fib(); // -> returns 1
fib(); // -> returns 2
Mathematics
Algorithms
Similar Kata:
Stats:
Created | Sep 2, 2013 |
Published | Sep 2, 2013 |
Warriors Trained | 1558 |
Total Skips | 98 |
Total Code Submissions | 5757 |
Total Times Completed | 920 |
JavaScript Completions | 906 |
CoffeeScript Completions | 30 |
Total Stars | 30 |
% of votes with a positive feedback rating | 81% of 156 |
Total "Very Satisfied" Votes | 110 |
Total "Somewhat Satisfied" Votes | 33 |
Total "Not Satisfied" Votes | 13 |