chiark / gitweb /
lines
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 2 Jul 2022 14:27:23 +0000 (15:27 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 2 Jul 2022 14:27:23 +0000 (15:27 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
overflow-tube.ps.pl

index 410257821de6b7d6583260b309921dd8eee3c688..ba1cb01c63e7f77b95e86f54b51058da55433981 100755 (executable)
@@ -93,6 +93,8 @@ END
     $ruby ||= 0;
     $x *= $colspacing;
     $y *= $spacing;
+    $x += $x_pl_zero;
+    $y += $y_pl_zero;
 
     $line .= " $x $y $line_word";
     $line_word = 'lineto';
@@ -104,7 +106,6 @@ END
     $o .= <<END;
 % place $x $y $money $veeps $ruby
 gsave
-  $x_pl_zero $y_pl_zero translate
   $x $y translate
   gsave ${\ chip($anychip, 0) } grestore
   -5 0 moveto ($money) show
@@ -115,20 +116,23 @@ END
     grestore
 END
 
-  ("newpath $line stroke", $o)
+  (" newpath $line stroke ", $o)
 }
 
 sub repis () {
-  for my $repi (0..$nrepis-1) {
-    o(<<END);
+  for my $places_i (qw(0 1)) {
+    for my $repi (0..$nrepis-1) {
+      o(<<END);
+% repi $places_i $repi
 gsave
   $repi $colspacing 2 mul mul  0 translate
 END
 
-    o( (places($repi))[1] );
-    o(<<END);
+      o( (places($repi))[$places_i] );
+      o(<<END);
 grestore
 END
+    }
   }
 }