Groovy web console

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

check

Published 3 weeks ago by Anonymous
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
f = { x -> x**3 }

r = 10
isGood = { x -> f(r) > f(x) }
 
println isGood(9)
println isGood(-5)
println isGood(10)