Created
April 7, 2013 14:50
-
-
Save hirokiky/5330787 to your computer and use it in GitHub Desktop.
Getting fibonacci series using block-chain (https://github.com/podhmo/block-chain)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from block.chain import chain, MaybeF | |
def fib(ctx, x): | |
x.append(x[-2] + x[-1]) | |
return x | |
print chain.chain.do(fib).do(fib).do(fib).do(fib).value(MaybeF(), [1, 1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment