Created
September 9, 2022 20:14
-
-
Save magniff/484ebe9f7d3f820b671ed486f49e18c8 to your computer and use it in GitHub Desktop.
fibonacci
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
| ( | |
| (lambda fibonacci: lambda v, then: fibonacci(fibonacci, v, then)) | |
| ( | |
| lambda fibonacci, value, then: | |
| then(1) | |
| if | |
| value == 0 or value == 1 | |
| else | |
| fibonacci( | |
| fibonacci, | |
| value - 1, | |
| lambda v_1: | |
| fibonacci( | |
| fibonacci, | |
| value - 2, | |
| lambda v_2: then(v_1 + v_2) | |
| ) | |
| ) | |
| )(10, then=lambda result: print("fibonacci(10) == %s" % result)) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment