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;
my @newstable;
-my $side = 8; # there are $side * $side CPUs
+my $side = 4; # there are $side * $side CPUs
for my $line (0 .. ($side - 1)) {
$cpus[$line] = [ ($line * $side) .. (($line + 1) * $side - 1) ]
}
for my $direction (0 .. $#diffs) {
- print "$direction: flag_or_news = {";
- printf 'latest_news[%2d]', $newstable[0][$direction];
- for my $cpu (1 .. ($side * $side - 1)) {
- printf ', latest_news[%2d]', $newstable[$cpu][$direction];
+ print "$direction: news_out = {";
+ 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 '};'
}