Permutations: Difference between revisions

No edit summary
Line 350:
 
=={{header|Aime}}==
<lang aime></lang>void
f1(record r, ...)
{
if (~r) {
for (text s in r) {
r.delete(s);
rcall(f1, -2, 0, -1, s);
r[s] = 0;
}
} else {
ocall(o_, -2, 1, -1, " ", ",");
o_newline();
}
}
 
main(...)
{
record r;
 
ocall(r_put, -2, 1, -1, r, 0);
f1(r);
 
0;
}</lang>
{{Out}}
<pre>aime permutations -a Aaa Bb C
<pre></pre>
Aaa, Bb, C,
Aaa, C, Bb,
Bb, Aaa, C,
Bb, C, Aaa,
C, Aaa, Bb,
C, Bb, Aaa,</pre>
 
=={{header|ALGOL 68}}==
Anonymous user