1require 'pp' 2 3def gcd(p, q) 4 return p if q == 0 5 gcd(q, p % q) 6end 7 8fail unless gcd(1440, 408) == 24 9fail unless gcd(102, 68) == 34 10