$page_pre ps_start
- arrow_any
+ arrow_any chip
);
END
};
+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 ps_start (;$) {
my ($adj) = @_;
$adj //= '';
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;