Sha256: e1cedfb54544e526c24a3aa751743f31e91a139e3a62b2953ccbd9247811bbba

Contents?: true

Size: 301 Bytes

Versions: 374

Compression:

Stored size: 301 Bytes

Contents

class Raindrops {

    private def primeSounds = [ 3:'Pling', 5:'Plang', 7:'Plong']

    def convert(num) {
        def result = new String()
        primeSounds.each({ k, v ->
            if ((num % k).equals(0)) { result += v }
        })
        result.isEmpty() ? num.toString() : result
    }

}

Version data entries

374 entries across 374 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.179 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.178 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.177 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.176 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.175 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.174 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.173 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.172 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.171 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.170 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.169 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.167 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.166 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.165 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.164 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.163 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.162 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.161 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.160 tracks/groovy/exercises/raindrops/Example.groovy