Sha256: 9747a568483f37e5a87a2b6457cbd148ec9f79f29c17f9055b46c6a819d1a757

Contents?: true

Size: 131 Bytes

Versions: 396

Compression:

Stored size: 131 Bytes

Contents

class Grains {
  def square(num) {
    2 ** (num - 1)
  }

  def total() {
    (1..64).inject() {sum, n -> sum += square(n)}
  }
}

Version data entries

396 entries across 396 versions & 1 rubygems

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