Knuth's algorithm S: Difference between revisions

Content added Content deleted
(→‎{{header|PARI/GP}}: Really? You want output for a self-reported incomplete solution?)
Line 466: Line 466:
let i = ref 0
let i = ref 0
and sample = ref [| |] in
and sample = ref [| |] in
function item ->
fun item ->
incr i;
incr i;
if !i <= n then sample := Array.append [| item |] !sample
if !i <= n then sample := Array.append [| item |] !sample