Sha256: b433167af9356f2b379683d750f7f716ddbaa72eba1a3c412c81759f88852e1d

Contents?: true

Size: 732 Bytes

Versions: 2

Compression:

Stored size: 732 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:18 @2)
a, b = ARGV[0..1].map {|arg| arg.to_i}
<= (gcd.rb:18 @11)
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
<- (gcd.rb:16 @88)
R=> 1
end
The GCD of 3 and 5 is 1
<= (gcd.rb:19 @73)
puts "The GCD of %d and %d is %d" % [a, b, gcd(a, b)]

Version data entries

2 entries across 2 versions & 1 rubygems

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