Knuth's algorithm S: Difference between revisions

m
(Realize in F#)
Line 1,243:
{29631,30097,29737,30252,29774,30147,29901,30042,30204,30215}
</pre>
Note that s_of_n_creator() must match {RID, I, SAMPLE}. You might instead prefer (taking the appropriate care not to miss any!):
<lang Phix>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</lang>
 
=={{header|PHP}}==
7,815

edits