#!/usr/bin/perl -w use strict; use Data::Dumper; my @b = p( 1, 2, 3 ); print Dumper( @b ); sub p { my@a=[];for(0..@_){@a=map{my@b=@$_;my@c=@_;for(@b){my$e=$_;for(1..@c +){my$d=shift@c;last if$d eq$e;push @c,$d}}@c?map{[@b,$_]}@c:[@b]}@a}@ +a }
In reply to Re: (Golf) Per Mutations
by Masem
in thread (Golf) Per Mutations
by MeowChow
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |