Sha256: 6eed82685ff0d5910f35b3495b7c1cc152161244e85c690d12f6ecb35a951ca7

Contents?: true

Size: 245 Bytes

Versions: 396

Compression:

Stored size: 245 Bytes

Contents

class Raindrops
  def self.drops(num : Int32)
    drops = String.build do |str|
      str << "Pling" if num % 3 == 0
      str << "Plang" if num % 5 == 0
      str << "Plong" if num % 7 == 0
    end
    drops.empty? ? num.to_s : drops
  end
end

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.159 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.158 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.157 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.156 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.155 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.154 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.153 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.152 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.151 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.150 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.149 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.148 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.147 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.146 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.145 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.144 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.143 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.142 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.141 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.140 tracks/crystal/exercises/raindrops/src/example.cr