Created
March 5, 2021 18:30
-
-
Save mertyildiran/755438cdac0a3ab52e4e9808051d629d to your computer and use it in GitHub Desktop.
Tak
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
def tak(x, y, z): | |
if y < x: | |
return tak( | |
tak(x-1, y, z), | |
tak(y-1, z, x), | |
tak(z-1, x, y) | |
) | |
else: | |
return z | |
print(tak(18, 12, 6)) | |
print(tak(55, 49, 84)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment