X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=newstable.pl;h=67957b8d8da967c0e78d3dd9446823630b007219;hb=refs%2Fheads%2Fcurium;hp=cbfbbd7da0594d2ab3b80800f418729e5a84e888;hpb=7f1b6bd9e0070ddc074215defc46d64abef645ac;p=clump.git diff --git a/newstable.pl b/newstable.pl index cbfbbd7..67957b8 100644 --- a/newstable.pl +++ b/newstable.pl @@ -4,13 +4,13 @@ use warnings; 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; @@ -35,8 +35,9 @@ for my $cpu (0 .. ($side * $side - 1)) { 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 '};'