in reply to Tedious Array Sort
Anyway, here is a solution. I'm not going to say which one it is, I suggest you look into it yourself If you are tempted to hand this in to your teacher.
PS, please show a bit more effort in your posts. You'll get more support and feedback.my $text="qwertyuiopasdfghjklzxcvbnm"; my @ltrs=split //,$text; my ($val,@set,@unset)=(1); while ($val) { push @{(ord($_) & $val) ? \@set : \@unset}, $_ foreach @ltrs; $val <<= 1; @ltrs=( splice( @unset, 0, @unset ), splice( @set, 0, @set ) ); } print join("-",@ltrs)."\n"
--- demerphq
my friends call me, usually because I'm late....
|
|---|