Groovy web console

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

Binomialkoeffizient

Published 10 months ago by Sebastian Butterweck
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
{ n, k -> { it -> { -> it > 1 ? it * owner.call(it-1) : 1 }() }(n) / ( { it -> { -> it > 1 ? it * owner.call(it-1) : 1 }() }(k) * { it -> { -> it > 1 ? it * owner.call(it-1) : 1 }() }(n-k) ) }(5,4)