Created
July 4, 2018 06:32
-
-
Save ebongzzang/7bdc696fed4dde3c217d33403d9f1557 to your computer and use it in GitHub Desktop.
groovy recursive closure
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 main() { | |
def input = 192 | |
def gcd | |
gcd = { int val, int remainder -> | |
if(remainder ==0){ | |
return val | |
} | |
return gcd(remainder, val % remainder) | |
} | |
print(gcd(1440, 408)) | |
} | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment