From: Ian Jackson Date: Thu, 28 Feb 2019 02:22:58 +0000 (+0000) Subject: wip X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=b08f272044a2136bab9a9f67fea870f8ce16287f;p=pandemic-rising-tide.git wip --- diff --git a/generate-board b/generate-board new file mode 100755 index 0000000..8f40dfb --- /dev/null +++ b/generate-board @@ -0,0 +1,38 @@ +#!/usr/bin/perl -w + +use strict; +use Carp; + +BEGIN { unshift @INC, qw(.); } + +use Parse; + +our ($plagf) = @ARGV or die; + +parse_input_graph(); + +our %prs2region; +our %v2pos; + +foreach my $rn (keys %region) { + my $prs = plag_prs($rn); + die if $prs2region{$prs}; + $prs2region{$prs} = $rn; +} + +my $sre = qr{(\")(.*)\1$}; # 2 captures, $2 is the name + +open P, "<", $plagf or die $!; +while (

) { + if (m/^$sre#/) { + my $invertex= $2; + } elsif (m/^ \@(.*),(.*)$/) { + die unless $invertex; + $v2pos{$invertex} = [ $1,$2 ]; + } elsif (m/^ \^lface $sre$/) { + die unless $invertex; + + +# Local variables: +# cperl-indent-level: 2 +# End.