Groovy web console

subscribe to the feed Subscribe
to this
site

Execution Order

Published 2 months ago by KK
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def test(x,b) {
    println "test($x,$b)"
    return b
}

println "-> ${test( 1, false) && test( 2, false) && test( 3, false)}"
println "-> ${test( 4, false)  & test( 5, false)  & test( 6, false)}"
println "-> ${test( 7, true ) || test( 8, true ) || test( 9, true )}"
println "-> ${test(10, true )  | test(11, true )  | test(12, true )}"

println "-> ${test(1,1) * test(2,2) + test(3,3) * test(4,4)}"
println "-> ${test(5,5) + test(6,6) * test(7,7) + test(8,8)}"