Skip to content

Instantly share code, notes, and snippets.

@magniff
Created September 9, 2022 20:14
Show Gist options
  • Select an option

  • Save magniff/484ebe9f7d3f820b671ed486f49e18c8 to your computer and use it in GitHub Desktop.

Select an option

Save magniff/484ebe9f7d3f820b671ed486f49e18c8 to your computer and use it in GitHub Desktop.
fibonacci
(
(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