Groovy web console

subscribe to the feed Subscribe
to this
site

kevin

Published 5 months ago by Anonymous
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
class Ivan {}
class Kevin {
    boolean estado = false
}

def ivan = new Ivan()
def kevin = new Kevin()

if (kevin == ivan)
    kevin.estado = feliz()
else
    kevinSeMataAPajas(kevin)

def boolean feliz() {
    true
}
def boolean triste() {
    false
}
def void kevinSeMataAPajas(Kevin kevin){
    kevin.estado = triste()
    10.times {
        println "chaca"
    }
}