chiark / gitweb /
Pumpkin values in md file
[quacks.git] / pumpkin-books.ps.pl
index 48070fa7f1253875a4caf45c77b34bc3e339e837..2b3dbbe275ba637b3d2d9804fa3c79c5fa4390f4 100755 (executable)
@@ -8,39 +8,6 @@ use strict;
 BEGIN { unshift @INC, '.'; }
 use Quacks;
 
-sub chip ($$) {
-  my ($cary, $pips) = @_; # put in a gsave translate
-  my $o = <<END;
-  newpath
-  0 0 chip 0.5 mul 0 360 arc
-  gsave 1 setlinewidth $black stroke grestore
-  ${\ colour($cary->[0]) } fill
-END
-  if ($pips) {
-    $o .= <<END;
-  ${\ colour($cary->[1]) }
-END
-  }
-  my $spot = sub {
-    my ($x,$y) = @_;
-    $o .= <<END;
-    newpath
-    spot 0.5 sqrt mul 1.1 mul dup
-    $x mul exch $y mul
-    spot 0.5 mul
-    0 360 arc fill
-END
-  };
-
-  $spot->( 0, 0) if $pips & 1;
-  $spot->(-1,-1) if $pips & 6;
-  $spot->(+1,+1) if $pips & 6;
-  $spot->(-1,+1) if $pips & 4;
-  $spot->(+1,-1) if $pips & 4;
-
-  $o;
-}
-
 sub veepsspot ($) {
   my ($chip) = @_;
   <<END;
@@ -74,19 +41,6 @@ grestore
 END
 }
 
-sub ruby () { # put in gsave translate
-  <<END;
-  newpath
-    rubysz neg  0 moveto
-    0  rubysz neg lineto
-    rubysz      0 lineto
-    0      rubysz lineto
-    closepath
-    ${\ colour('1 .2 .2') } gsave fill grestore
-    $black 1 setlinewidth stroke
-END
-}
-
 sub exposition ($) {
   my ($text) = @_;
   my $fontsz = 6;
@@ -260,7 +214,7 @@ END
 }
 
 sub book_blue () {
-  my $o = general_book($blue, [qw(4 10 18)]);
+  my $o = general_book($blue, [qw(4 9 17)]);
 
   $o .= <<END;
 /Times-Bold findfont 15 scalefont setfont $black
@@ -312,7 +266,8 @@ END
   $o .= $exchline->(1, 2, <<END);
   ${\ $exchip->($moth,1) }  ${\ $exslash->() }
   ${\ $exchip->($purple,1) }  ${\ $exslash->() }
-  ${\ anychip(2) }
+  ${\ $exchip->($lotus,0) }  ${\ $exslash->() }
+  ${\ $exchip->($anychip,2) }
 END
 
   $o .= $exchline->(0, 4, <<END);
@@ -368,7 +323,7 @@ END
   $o .= exposition(<<END);
 The value of this chip is
 1 higher than the number of pumpkins
-previously placed in the pot (but max.4)
+in the pot (but max.4)
 END
 
   $o;
@@ -424,25 +379,25 @@ END
 }
 
 sub book_yellow () {
-  my $o = general_book($yellow, [qw(7 12 19)]);
+  my $o = general_book($yellow, [qw(5 11 19)]);
 
   $o .= <<END;
 gsave
-  0.50 0.62 dc translate
-  0.65 dup scale
+  0.52 0.32 dc translate
+  0.80 dup scale
   -26 0 translate
-  gsave 26 0 translate ${\ chip($anychip,0) } grestore
+  gsave 26 0 translate ${\ chip($yellow,0) } grestore
   gsave 46 0 translate ${\ chip($pumpkin,0) } grestore
-  gsave -30 rotate bag_image grestore
-  8 14 translate
-  -120 rotate
+  34 14 translate
+  -22.5 rotate
+  1 -1 scale
   ${\ arrow_any("
     gsave
      arrowlen 0 translate
   -85 rotate
-    putback_len neg 0
-      putback_len
-      240 0 arc
+    -40 0
+      40
+      300 0 arc
     stroke
     grestore
   ") }
@@ -462,44 +417,11 @@ END
 END
   };
   
-  my $exchline = sub {
-    my ($y, $pips, $content) = @_;
-    <<END;
-gsave 
-  0.20 0.12 0.16 $y mul add dc translate
-  0.60 dup scale
-  gsave ${\ chip($yellow,$pips) } grestore
-  8 -3 moveto (:) show
-  3 0 translate
-  0.8 dup scale
-  24 0 translate
-$content
-grestore
-END
-  };
-
-  $o .= $exchline->(2, 1, <<END);
-  ${\ $exchip->($white,1) }  ${\ $exslash->() }
-  ${\ $exchip->($anychip,1) }  ${\ $exslash->() }
-  ${\ $exchip->($lotus,0) }
-END
-
-  $o .= $exchline->(1, 2, <<END);
-  ${\ $exchip->($white,2) }  ${\ $exslash->() }
-  ${\ $exchip->($anychip,2) }
-END
-
-  $o .= $exchline->(0, 4, <<END);
-  ${\ $exchip->($white,3) }  ${\ $exslash->() }
-  ${\ $exchip->($anychip,4) }
-END
-
   $o .= exposition(<<END);
-Put a chip, no bigger than the yellow,
-whose next placed chip is a pumpkin,
-back in your bag.                
-
+Move up to 1/2/4 pumpkins
+already in your pot, to after the yellow.
+(always immediately after, only one space,
+regardless of other rules)
 END
 
   $o;
@@ -588,7 +510,7 @@ END
 
   $o;
 }
-ps_start();
+ps_start('7 30 translate');
 
 sub def_image ($$) {
   my ($ncomps, $name) = @_;