my @diffs = (
[-1, 0],
-# [-1, 1],
[0 , 1],
-# [1 , 1],
[1 , 0],
-# [1 , -1],
[0 , -1],
-# [-1, -1]
+ [-1, -1],
+ [-1, 1],
+ [1 , 1],
+ [1 , -1],
);
my @cpus;
for my $direction (0 .. $#diffs) {
print "$direction: news_out = {";
- printf 'news_in[%2d]', $newstable[0][$direction];
- for my $cpu (1 .. ($side * $side - 1)) {
+ printf 'news_in[%2d]', $newstable[$side * $side - 1][$direction];
+ my @lst = 0 .. ($side * $side - 2);
+ for my $cpu (reverse @lst) {
printf ', news_in[%2d]', $newstable[$cpu][$direction];
}
say '};'