Sha256: 884d716bbbbbcca14007270ac5eb1b270b69448b2c1d599b58d84715b7c523f2

Contents?: true

Size: 273 Bytes

Versions: 22

Compression:

Stored size: 273 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

22 entries across 22 versions & 1 rubygems

Version Path
trackler-2.0.1.0 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.0.0.10 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.0.0.9 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.0.0.8 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.0.0.7 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.0.0.6 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.0.0.5 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.0.0.4 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.0.0.3 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.0.0.2 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.0.0.1 tracks/groovy/exercises/raindrops/Example.groovy
trackler-2.0.0.0 tracks/groovy/exercises/raindrops/Example.groovy
trackler-1.0.4.1 tracks/groovy/exercises/raindrops/Example.groovy
trackler-1.0.4.0 tracks/groovy/exercises/raindrops/Example.groovy
trackler-1.0.3.0 tracks/groovy/exercises/raindrops/Example.groovy
trackler-1.0.2.1 tracks/groovy/exercises/raindrops/Example.groovy
trackler-1.0.2.0 tracks/groovy/exercises/raindrops/Example.groovy
trackler-1.0.1.2 tracks/groovy/exercises/raindrops/Example.groovy
trackler-1.0.1.1 tracks/groovy/exercises/raindrops/Example.groovy
trackler-1.0.1.0 tracks/groovy/exercises/raindrops/Example.groovy