Sha256: c9d991a00f860d1bb2a8e344bf1830536f668c07163c4d3cd08eb9d8a80fd6d5
Contents?: true
Size: 285 Bytes
Versions: 193
Compression:
Stored size: 285 Bytes
Contents
module BookKeeping VERSION = 1 end module CollatzConjecture def self.steps(num) raise ArgumentError if num < 1 n = num steps = 0 until n == 1 steps += 1 if n.even? n /= 2 else n = 3 * n + 1 end end steps end end
Version data entries
193 entries across 193 versions & 1 rubygems