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


in reply to sloooowwwwww code!

Here's a little tip to get you going:
my @directions = ('w', 'sw', 's', 'se', 'e', 'ne', 'n', 'nw'); my $anchor = $directions[int($real_angle/45 + 0.5)];
this piece of untested code would save you 40 lines of code. Not bad eh? Before thinking of speed, try to see if you can make your code more compact.