From: Ian Jackson Date: Sat, 2 Jul 2022 12:13:45 +0000 (+0100) Subject: break out chip X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=5151bfffa1f2934aa63ba23de32fc481f57145a3;p=quacks.git break out chip Signed-off-by: Ian Jackson --- diff --git a/Quacks.pm b/Quacks.pm index 11cfe13..7ae0b2c 100644 --- a/Quacks.pm +++ b/Quacks.pm @@ -17,7 +17,7 @@ our @EXPORT = qw( $page_pre ps_start - arrow_any + arrow_any chip ); @@ -65,6 +65,39 @@ sub arrow_any ($) { <[0]) } fill +END + if ($pips) { + $o .= <[1]) } +END + } + my $spot = sub { + my ($x,$y) = @_; + $o .= <( 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 //= ''; diff --git a/pumpkin-books.ps.pl b/pumpkin-books.ps.pl index fbe71e4..3c36472 100755 --- a/pumpkin-books.ps.pl +++ b/pumpkin-books.ps.pl @@ -8,39 +8,6 @@ use strict; BEGIN { unshift @INC, '.'; } use Quacks; -sub chip ($$) { - my ($cary, $pips) = @_; # put in a gsave translate - my $o = <[0]) } fill -END - if ($pips) { - $o .= <[1]) } -END - } - my $spot = sub { - my ($x,$y) = @_; - $o .= <( 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) = @_; <