chiark / gitweb /
knifeblock: wip, half-done template reorg
[reprap-play.git] / knifeblock-knives-filter
1 #!/usr/bin/perl -wn
2
3 use strict;
4
5 our %want;
6
7 BEGIN {
8       my $want = shift @ARGV;
9       my ($part,$knife) = $want =~ m/^([ha])(\d)$/ or die;
10
11       $want{ $knife+1 } = $part =~ m/[h]/;
12       $want{ $knife+4 } = $part =~ m/[ha]/;
13 }
14
15 our $drop;
16
17 if (m/^\S/) {
18     $drop = 
19         m/^2 / ||
20         (m/^3 \d+ \d+ \d+ (\d+) / && !$want{$1});
21 }
22
23 next if $drop;
24
25 print or die $!;