END
}
+sub exposition ($) {
+ my ($text) = @_;
+ my $fontsz = 6;
+ my $o = <<END;
+ /Times-Roman findfont $fontsz scalefont setfont $black
+END
+ $text =~ s/\s+$//;
+ my @lines = split /\n/, $text;
+ foreach my $y (0..$#lines) {
+ my $l = $lines[$y];
+ $l =~ s/[()\\]/\\$&/g;
+ my $yd = $fontsz * (0.5*@lines - $y);
+ $o .= <<END;
+ 0 0.70 dc moveto
+ 0 $yd rmoveto
+ ($l) dup stringwidth pop -0.5 mul 0 rmoveto
+ show
+END
+ }
+ $o;
+}
+
sub general_book ($$) {
my ($this, $costs) = @_;
my $o = <<END;
90 rotate
10 10 translate
-$black
-1 setlinewidth
-
/tw 57.5 def
/th 73 def
/bdiag 5 def
exch % x y
} def
+3 setlinewidth
+0 0 0 0.2 setcmykcolor
+newpath
+0 0 dc moveto
+0 1 dc lineto stroke
+
+$black
+1 setlinewidth
+
newpath
-1 0 dc moveto
+1 0 dc lineto
newpath
0 0 dc moveto
-0 1 dc rlineto stroke
+0 thirdlineh dc rlineto
+-1 thirdlineh dc lineto stroke
/thirddivline { % xprop
newpath
1 thirddivline
2 thirddivline
-newpath
--1 thirdlineh dc moveto
-0 thirdlineh dc lineto stroke
END
foreach my $costi (0..2) {
0.85 0.275 dc translate
${\ ruby() }
grestore
+END
+
+ $o .= exposition(<<END);
+For each pumpkin in the last 3 chips,
+but not more than the number of
+green chips in your pot,
+receive 1 ruby.
END
$o;