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.180 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.179 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.178 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.177 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.176 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.175 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.174 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.173 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.172 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.171 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.170 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.169 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.167 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.166 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.165 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.164 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.163 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.162 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.161 tracks/crystal/exercises/raindrops/src/example.cr
trackler-2.2.1.160 tracks/crystal/exercises/raindrops/src/example.cr