USING: io kernel math math.order math.ranges sequences ; IN: golf-choose : nk-choose ( n-up k-down -- x ) 2dup swap [ 0 ] dip between? [ 2dup - rot (a,b] swap 1 max [1,b] 1 [ / * ] 2reduce ] [ 2drop 0 ] if ;