chiark / gitweb /
wip numbering
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 26 Oct 2021 22:56:56 +0000 (23:56 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 26 Oct 2021 22:56:56 +0000 (23:56 +0100)
pumpkin-books.ps.pl

index c3f8ae8423e9ce8b09075aa2aac5ec9f99d71a0d..3be2e0060ba29db09c6664077894f067a7ea54bc 100755 (executable)
@@ -454,7 +454,15 @@ END
 }
 
 sub tile {
-  my $index = scalar @_;
+  my @tiles;
+  my $index_i = 1;
+  foreach my $d (@_) {
+    foreach my $dd (ref $d ? @$d : $d) {
+      push @tiles, [ $dd, $index_i ];
+    }
+    $index_i++;
+  }      
+
   my $pos = 0;
   my $o = '';
   my $showpage = sub {
@@ -463,7 +471,10 @@ showpage
 $page_pre
 END
   };
-  while (my $d = pop @_) {
+
+  while (my $di = pop @tiles) {
+    my ($d, $index) = @$di;
+
     if ($pos >= 5) {
       $pos -= 5;
       $showpage->();
@@ -493,7 +504,6 @@ END
 grestore
 END
     $pos++;
-    $index--;
   }
   $showpage->();
   $o;
@@ -709,7 +719,6 @@ print tile(
           blue_book(),
           lotus_book(),
           yellow_book(),
-          black_book_pair(),
-          black_book_more(),
+          [black_book_pair(), black_book_more()],
          ) or die $! if 1;