Created
July 25, 2014 16:24
-
-
Save pce/d3c504f6a83f28d3ab4a to your computer and use it in GitHub Desktop.
euclidian
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
| #!/bin/env ruby | |
| def euclid(m, k) | |
| if k==0 | |
| return m | |
| else | |
| return euclid(k, m%k) | |
| end | |
| end | |
| puts euclid(2,8) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment