Groovy web console

subscribe to the feed Subscribe
to this
site
Tono (via #groovywebconsole)
tweet this snippet Tweet
this
script

Tono

Published 2 months ago by necro
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
1.upto(20) { step ->
  println "Step ke: " + step.toString()
  def jumlahLampu = 0
  step.upto(20) { 
    if(it % step == 0){
      println it
      jumlahLampu++
    }
  }
  println "Jumlah lampu menyala: " + jumlahLampu
  println "========================="
}