Permutations: Difference between revisions
Content deleted Content added
VBA |
|||
Line 645:
3,2,1</lang>
=={{header|Common Lisp}}==
<lang lisp>(defun permute (list)
(if list
(mapcan #'(lambda (x)
(mapcar #'(lambda (y) (cons x y))
(permute (remove x list))))
list)
'(()))) ; else
(print (permute '(A B Z)))</lang>output<lang>((A B Z) (A Z B) (B A Z) (B Z A) (Z A B) (Z B A))</lang>
=={{header|D}}==
<lang d>import std.stdio: writeln;
|