X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=quacks-ingredients-counts;h=46d7f1bee8c294027a22e71bca1eeaa1627866b3;hb=c8d10b1959359d727f4fa1daf42c5985d6bf46d1;hp=15e6bd8c52ad5325d053964c85a90375de365c02;hpb=4cf336ec8769a245df0938c73d926066c0551d3d;p=reprap-play.git diff --git a/quacks-ingredients-counts b/quacks-ingredients-counts index 15e6bd8..46d7f1b 100755 --- a/quacks-ingredients-counts +++ b/quacks-ingredients-counts @@ -39,7 +39,7 @@ foreach my $nspots (qw(1 2 3 4)) { m/\+/; $count{$names[$i]}{$nspots} = - $which eq 'Both' ? $` + $' : + $which eq 'All' ? $` + $' : $which eq 'Base' ? $` : $which eq 'Witches' ? $' : die "$which ?"; @@ -57,7 +57,7 @@ our $max_nrows=0; our $max_rowsz=0; sub wrtoplevel () { - print "module $name(){ ////toplevel\n"; + print "module ${which}_$name(){ ////toplevel\n"; my $cs = $count{$name}; my $total = 0; $total += $_ foreach values %$cs; my $rowsz = ceil(sqrt($total)); @@ -67,8 +67,8 @@ sub wrtoplevel () { $max_nrows = $nrows if $nrows > $max_nrows; $max_rowsz = $rowsz if $rowsz > $max_rowsz; my $ix = 0; - printf "// %-10s total=%2d rowsz=$rowsz nrows=$nrows\n", - "$name", $total; + printf "// %s %-10s total=%2d rowsz=$rowsz nrows=$nrows\n", + $which, "$name", $total; foreach my $nspots (sort keys %$cs) { my $c = $cs->{$nspots}; print <error and die $!;