-
-
Save yrashk/aafded15a61bc081fcd1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
fib_list(0) -> 0; | |
fib_list(1) -> 1; | |
fib_list(N) -> | |
fib_list(N + 1, [1,0]). | |
fib_list(End, [H|_]=L) when length(L) == End -> H; | |
fib_list(End, [A,B|_]=L) -> | |
fib_list(End, [A+B|L]). |
Either way, the point was to show one person how lists are constructed
Right.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I agree