RosettaCodeData/Task/Knuths-algorithm-S/Phix/knuths-algorithm-s-2.phix

10 lines
240 B
Plaintext

enum RID, I, SAMPLE, CLOSURE_LEN=$
...
function s_of_n_creator(int n)
sequence closure = repeat(0,CLOSURE_LEN)
closure[RID] = routine_id("s_of_n")
closure[I] = 0
closure[SAMPLE] = repeat(0,n)
return closure
end function