http://qs321.pair.com?node_id=665341


in reply to Golf/Perlish solution to this problem?

timtowtdi

#!/usr/bin/perl use strict; use warnings; @_ = ( 1 .. 12 ); my @a = map { my @l = (($#_+1)-$_ => $_+1); ($_+1)%2 ? @l : reverse @l; } 0..$#_>>1; print "@a";

Output : 12 1 2 11 10 3 4 9 8 5 6 7

PooLpi