Josephus problem: Difference between revisions
m
J: Add spaces around the subtraction to help mislead eyes slightly less when they have been [mis-]trained by some OO syntax
m (J: Add spaces around the subtraction to help mislead eyes slightly less when they have been [mis-]trained by some OO syntax) |
|||
Line 1,031:
=== Explicit version 2 ===
<lang J>
Josephus2 =: 4 : '(|x&+)/i. - >:y' NB. this is a direct translation of the algo from C code above.
3 Josephus2 41
|