Groovy web console

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

Mega_aleat?ia

Published 6 months ago by amadafoca
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def random = new Random()
def array = (1..60).toList()

def number

(1..6).each {
    number = random.nextInt(60)
    if (array.contains(number)) {
        println number
        array.remove(array.indexOf(number))
    }
}