10 foreach my $count (qw(1 2 3)) {
11 foreach my $nspots (qw(1 2 3 4)) {
12 $_ = $cb->($count,$nspots)."\t".$_;
17 $_=<DATA>; chomp or die;
19 my ($xcount,$xnspots) = @_;
20 "${xcount}x". (qw(X One Two Three Four)[$xnspots]);
22 our @names = split /\t/, $_;
26 foreach my $nspots (qw(1 2 3 4)) {
27 $_=<DATA>; chomp or die;
29 my ($xcount,$xnspots) = @_;
30 $xnspots == $nspots and $xcount;
32 my @l = split /\t/, $_;
33 foreach my $i (0..$#names) { $count{$names[$i]}{$nspots} = $l[$i] || 0; }
41 our $total_real_count;
46 print "module $name(){ ////toplevel\n";
47 my $cs = $count{$name};
48 my $total = 0; $total += $_ foreach values %$cs;
49 my $rowsz = ceil(sqrt($total));
50 my $nrows = ceil($total / $rowsz);
51 $total_count += $total;
52 $total_real_count += $total if $name =~ m/^[A-Z][a-z]+$/;
53 $max_nrows = $nrows if $nrows > $max_nrows;
54 $max_rowsz = $rowsz if $rowsz > $max_rowsz;
56 printf "// %-10s total=%2d rowsz=$rowsz nrows=$nrows\n",
58 foreach my $nspots (sort keys %$cs) {
59 my $c = $cs->{$nspots};
62 Frame(\$phase, token_pitch * [ $rowsz + 1.00, $nrows + 0.50 ]);
66 my $xy = sprintf "[ %5.1f, %5.1f ]",
67 int($ix / $nrows) - 0.5 * ($rowsz-1),
68 $ix % $nrows - 0.5 * ($nrows-1);
69 print " translate(token_pitch * $xy) Token_L();\n";
79 foreach $name (sort keys %count) {
84 // total_count=$total_count total_real_count=$total_real_count
85 // max_rowsz=$max_rowsz max_nrows=$max_nrows
88 STDOUT->error and die $!;
91 White Green Blue Red Yellow Purple Black Orange
92 20 15 14 12 13 15 18 20