Code: Select all
my @areas = (
[
[ 0, 4],[ 0, 3],[-1, 3],[ 1, 3],[-1, 4],
[ 1, 4],[-1, 5],[ 1, 5],[ 0, 5],[ 0, 2],
[-1, 2],[ 1, 2],[-2, 2],[ 2, 2],[-2, 3],
[ 2, 3],[-2, 4],[ 2, 4],[-2, 5],[ 2, 5],
[-2, 6],[ 2, 6],[-1, 6],[ 1, 6],[ 0, 6],
],
[
[-3, 3],[-3, 2],[-2, 3],[-4, 3],[-3, 4],
[-2, 2],[-3, 1],[-1, 3],[-4, 2],[-2, 4],
[-5, 3],[-3, 5],[-4, 4],[-2, 1],[-1, 2],
[-3, 0],[ 0, 3],[-4, 1],[-1, 4],[-5, 2],
[-2, 5],[-6, 3],[-3, 6],[-5, 4],[-4, 5],
],
[
[-4, 0],[-3, 0],[-3,-1],[-3, 1],[-4,-1],
[-4, 1],[-5,-1],[-5, 1],[-5, 0],[-2, 0],
[-2,-1],[-2, 1],[-2,-2],[-2, 2],[-3,-2],
[-3, 2],[-4,-2],[-4, 2],[-5,-2],[-5, 2],
[-6,-2],[-6, 2],[-6,-1],[-6, 1],[-6, 0],
],
[
[-3,-3],[-2,-3],[-3,-2],[-3,-4],[-4,-3],
[-2,-2],[-1,-3],[-3,-1],[-2,-4],[-4,-2],
[-3,-5],[-5,-3],[-4,-4],[-1,-2],[-2,-1],
[ 0,-3],[-3, 0],[-1,-4],[-4,-1],[-2,-5],
[-5,-2],[-3,-6],[-6,-3],[-4,-5],[-5,-4],
],
[
[ 0,-4],[ 0,-3],[ 1,-3],[ 1,-3],[ 1,-4],
[-1,-4],[ 1,-5],[-1,-5],[ 0,-5],[ 0,-2],
[ 1,-2],[-1,-2],[ 2,-2],[-2,-2],[ 2,-3],
[-2,-3],[ 2,-4],[-2,-4],[ 2,-5],[-2,-5],
[ 2,-6],[-2,-6],[ 1,-6],[-1,-6],[ 0,-6],
],
[
[ 3,-3],[ 3,-2],[ 2,-3],[ 4,-3],[ 3,-4],
[ 2,-2],[ 3,-1],[ 1,-3],[ 4,-2],[ 2,-4],
[ 5,-3],[ 3,-5],[ 4,-4],[ 2,-1],[ 1,-2],
[ 3, 0],[ 0,-3],[ 4,-1],[ 1,-4],[ 5,-2],
[ 2,-5],[ 6,-3],[ 3,-6],[ 5,-4],[ 4,-5],
],
[
[ 4, 0],[ 3, 0],[ 3, 1],[ 3,-1],[ 4, 1],
[ 4,-1],[ 5, 1],[ 5,-1],[ 5, 0],[ 2, 0],
[ 2, 1],[ 2,-1],[ 2, 2],[ 2,-2],[ 3, 2],
[ 3,-2],[ 4, 2],[ 4,-2],[ 5, 2],[ 5,-2],
[ 6, 2],[ 6,-2],[ 6, 1],[ 6,-1],[ 6, 0],
],
[
[ 3, 3],[ 2, 3],[ 3, 2],[ 3, 4],[ 4, 3],
[ 2, 2],[ 1, 3],[ 3, 1],[ 2, 4],[ 4, 2],
[ 3, 5],[ 5, 3],[ 4, 4],[ 1, 2],[ 2, 1],
[ 0, 3],[ 3, 0],[ 1, 4],[ 4, 1],[ 2, 5],
[ 5, 2],[ 3, 6],[ 6, 3],[ 4, 5],[ 5, 4],
],
);
my $_l = $::char->{look}{body} - 0;
my @area = @{$areas[$_l]};
foreach my $_z (@area) {
#...
}
It'd avoid all the first if statement. What do you think? I was reading some spanish forum and found something similar so I though it'd work.
P.s: For the tables, I did it while talking to my girlfriend but I didn't thing I was so unconcentrated. xD