Mind boggling card trick: Difference between revisions
→{{header|Javascript}}: (Slight simplification of threeStacks function by currying)
m (→{{header|REXX}}: fixed code to not shuffle the same card.) |
(→{{header|Javascript}}: (Slight simplification of threeStacks function by currying)) |
||
Line 374:
// threeStacks :: [Chars] -> ([Chars], [Chars], [Chars])
const threeStacks = cards => {
const go = ([rs, bs, ds]
const lng = xs.length;
return 0 < lng ? (
1 < lng ? (() => {
const
return
)(drop(2, xs))
})() : [rs, bs, ds_]
) : [rs, bs, ds];
};
Line 391 ⟶ 393:
[],
[]
]
};
|