From: Ian Jackson Date: Mon, 14 Jan 2019 02:54:57 +0000 (+0000) Subject: L too X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=494bb73099ebca1e506fafa2e07feabb3543ea9d;p=pandemic-rising-tide.git L too --- diff --git a/input-graph b/input-graph index 1660eb9..1c7d6f2 100644 --- a/input-graph +++ b/input-graph @@ -1,11 +1,13 @@ purple Noorderzijlvest NZ + + L Drenthe Fryslan Fryslan NZ + N.t + L Drenthe Vollenhove Noordoostpolder + @@ -43,6 +45,7 @@ purple high Drenthe + L Twente Vollenhove F. @@ -95,18 +98,21 @@ yellow high Twente + L Rijn en Ijssel Vo. Dr. yellow Rijn en Ijssel + L Betuwe + Ve. Ij. + Vo. ++ Tw. Betuwe + L R.e.Ij. + Land van Maas en Waal + Land van Heusden + @@ -125,13 +131,16 @@ yellow green Roer en Overmaas + L Oost-Brabant Peel en Maasvallei + Peel en Maasvallei + L R.e.O. + Oost-Brabant Land van Maas en Waal + Land van Maas en Waal + L P.e.M. + Oost-Brabant Land van Heusden ++ @@ -139,6 +148,7 @@ green high Oost-Brabant + L West-Brabant Land van Heusden L..W. @@ -159,6 +169,7 @@ green B. L.v.H. + West-Brabant + L De Zoom Schouwen-Duiveland + Goeree-Overflakkee + @@ -204,10 +215,12 @@ red Zuid-Beveland S-D. + De Zoom + L Zeeuws-Vlaanderen + Walcheren + Zeeuws-Vlaanderen Z-B. + + L Walcheren + NZ + Walcheren @@ -218,23 +231,25 @@ red high De Zoom + L Z-B. S-D. W-B. sea NZ - Z-V. + - Wa. + - S-D. + - G-O. + - V-P. + - De. + - Ke. + - Wie. - ZZ - Fr. + N.t + + Fr. + + ZZ + Wie. + Ke. + + De. + + V-P. + + G-O. + + S-D. + + Wa. + + Z-V. + + L ZZ NZ @@ -244,3 +259,21 @@ sea Ma. Ke. + Wie. + +high + L + NZ + Z-V. + Z-B. + De Zoom + W-B. + O-B. + R.e.O. + P.e.M. + L..W. + Betuwe + R..Ij. + Tw. + Dr. + Fr. + N.t diff --git a/parse-input-graph b/parse-input-graph index 5221c17..fec1ef8 100755 --- a/parse-input-graph +++ b/parse-input-graph @@ -30,7 +30,7 @@ sub read_in () { $ccolour = $&; next; } - if (my ($name, $water) = m{^\t(\S.*\w)(?: \[(\d+)\])?$}) { + if (my ($name, $water) = m{^\t(\S.*\w|L)(?: \[(\d+)\])?$}) { confess unless defined $ccolour; confess "$name ?" if $region{$name}; $region{$name}{Colour} = $ccolour; @@ -39,7 +39,7 @@ sub read_in () { $cregion = $name; next; } - if (my ($aref, $adikes) = m{^\t\t(\S.*[A-Za-z.])(?: (\+\+?))?$}) { + if (my ($aref, $adikes) = m{^\t\t(\S.*[A-Za-z.]|L)(?: (\+\+?))?$}) { my $adj = { Dikes => (length $adikes // 0), L => $. }; if ($aref =~ m{\.}) { $adj->{Pattern} = $aref; @@ -111,6 +111,7 @@ sub edges () { foreach my $adja (@{ $region{$ra}{Adj} }) { my $rb = $adja->{Name}; my ($r0,$r1) = sort { + ($a eq 'L' ) <=> ($b eq 'L' ) or ($a eq 'NZ') <=> ($b eq 'NZ') or $a cmp $b } ($ra,$rb); @@ -147,8 +148,8 @@ END foreach my $r1 (sort keys %{ $edges{$r0} }) { my $e = $edges{$r0}{$r1}; my $r1n = $r1; - if ($r1 eq 'NZ') { - $r1n = "_NZ $r0"; + if ($r1 eq 'NZ' || $r1 eq 'L') { + $r1n = "_$r1 $r0"; next; } o "\"$r0\" -- \"$r1n\";\n";