8 $_=<DATA>; chomp or die;
9 our @names = split /\t/, $_;
13 foreach my $nspots (qw(1 2 3 4)) {
14 $_=<DATA>; chomp or die;
15 my @l = split /\t/, $_;
16 foreach my $i (0..$#names) { $count{$names[$i]}{$nspots} = $l[$i] || 0; }
25 print "module $name(){ ////toplevel\n";
26 my $cs = $count{$name};
27 my $total = 0; $total += $_ foreach values %$cs;
28 my $rowsz = ceil(sqrt($total));
29 my $nrows = ceil($total / $rowsz);
31 print "// total=$total, rowsz=$rowsz, nrows=$nrows\n";
32 foreach my $nspots (sort keys %$cs) {
33 my $c = $cs->{$nspots};
36 Frame(\$phase, token_pitch * [ $rowsz + 0.5, $nrows ]);
40 my $xy = sprintf "[ %5.1f, %5.1f ]",
41 int($ix / $nrows) - 0.5 * ($rowsz-1),
42 $ix % $nrows - 0.5 * ($nrows-1);
43 print " translate(token_pitch * $xy) Token_L();\n";
53 foreach $name (sort keys %count) {
57 STDOUT->error and die $!;
60 White Green Blue Red Yellow Purple Black Orange
61 20 15 14 12 13 15 18 20