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; }
45 print "module $name(){ ////toplevel\n";
46 my $cs = $count{$name};
47 my $total = 0; $total += $_ foreach values %$cs;
48 my $rowsz = ceil(sqrt($total));
49 my $nrows = ceil($total / $rowsz);
50 $total_count += $total;
51 $max_nrows = $nrows if $nrows > $max_nrows;
52 $max_rowsz = $rowsz if $rowsz > $max_rowsz;
54 print "// total=$total, rowsz=$rowsz, nrows=$nrows\n";
55 foreach my $nspots (sort keys %$cs) {
56 my $c = $cs->{$nspots};
59 Frame(\$phase, token_pitch * [ $rowsz + 1.00, $nrows + 0.50 ]);
63 my $xy = sprintf "[ %5.1f, %5.1f ]",
64 int($ix / $nrows) - 0.5 * ($rowsz-1),
65 $ix % $nrows - 0.5 * ($nrows-1);
66 print " translate(token_pitch * $xy) Token_L();\n";
76 foreach $name (sort keys %count) {
81 // total_count=$total_count
82 // max_rowsz=$max_rowsz max_nrows=$max_nrows
85 STDOUT->error and die $!;
88 White Green Blue Red Yellow Purple Black Orange
89 20 15 14 12 13 15 18 20