Here's a more tacit version with repetitions
toss3=: 4 : 0"0
n=. #y=. ((>.x^.y) # x) #: y-1
if. n > i=. >:y (> i. 1:) r=. ?y+1 do.
r=. (i{.r) , ? (n-i) # x end.
x#.r
)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
- [Jbeta] monadic '?' Andrew Nikitin
- Re: [Jbeta] monadic '?' Oleg Kobchenko
- Re: [Jbeta] monadic '?' Oleg Kobchenko
- Re: [Jbeta] monadic '?' Oleg Kobchenko
- Re: [Jbeta] monadic '?' Oleg Kobchenko
- [Jbeta] monadic '?' Andrew Nikitin
- Re: [Jbeta] monadic '?' Roger Hui
- [Jbeta] monadic '?' Andrew Nikitin
