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.119 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.118 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.117 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.116 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.115 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.114 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.113 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.111 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.110 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.109 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.108 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.107 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.106 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.105 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.104 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.103 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.102 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.101 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.100 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.2.1.99 tracks/groovy/exercises/raindrops/Example.groovy