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 print "// $name: total=$total, rowsz=$rowsz, nrows=$nrows\n";
57 foreach my $nspots (sort keys %$cs) {
58 my $c = $cs->{$nspots};
61 Frame(\$phase, token_pitch * [ $rowsz + 1.00, $nrows + 0.50 ]);
65 my $xy = sprintf "[ %5.1f, %5.1f ]",
66 int($ix / $nrows) - 0.5 * ($rowsz-1),
67 $ix % $nrows - 0.5 * ($nrows-1);
68 print " translate(token_pitch * $xy) Token_L();\n";
78 foreach $name (sort keys %count) {
83 // total_count=$total_count total_real_count=$total_real_count
84 // max_rowsz=$max_rowsz max_nrows=$max_nrows
87 STDOUT->error and die $!;
90 White Green Blue Red Yellow Purple Black Orange
91 20 15 14 12 13 15 18 20