Sha256: bf3ca0b847e3d8785bb5951c2a9d89798f79103c57592e2658594a9e7ce46b61

Contents?: true

Size: 543 Bytes

Versions: 4

Compression:

Stored size: 543 Bytes

Contents

-- (gcd.rb:4 @2)
def gcd(a, b)
-- (gcd.rb:18 @2)
a, b = ARGV[0..1].map {|arg| arg.to_i}
-- (gcd.rb:19 @45)
puts "The GCD of %d and %d is %d" % [a, b, gcd(a, b)]
-- (gcd.rb:6 @4)
if a > b
-- (gcd.rb:12 @40)
if a == 1 or b-a == 0
METHOD Object#gcd(a, b)
-> (gcd.rb:4 @2)
def gcd(a, b)
-- (gcd.rb:10 @24)
return nil if a <= 0
-- (gcd.rb:15 @71)
return gcd(b-a, a)
-- (gcd.rb:6 @4)
if a > b
-- (gcd.rb:12 @40)
if a == 1 or b-a == 0
<- (gcd.rb:13 @68)
R=> 1
return a
<- (gcd.rb:16 @88)
R=> 1
end
The GCD of 3 and 5 is 1

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
trepanning-2.15.35 test/data/trace-mingw.right
trepanning-1.93.35 test/data/trace-mingw.right
trepanning-2.15.33 test/data/trace-mingw.right
trepanning-1.93.32 test/data/trace-mingw.right