From 105cb86d44468873f182b655a67b5f14cedca60c Mon Sep 17 00:00:00 2001 From: Yanick Champoux Date: Tue, 19 Dec 2017 11:49:15 -0500 Subject: [PATCH] day19 --- 19/1.pl | 56 ++++++++++++++ 19/input.txt | 201 +++++++++++++++++++++++++++++++++++++++++++++++++++ 19/test | 6 ++ 3 files changed, 263 insertions(+) create mode 100644 19/1.pl create mode 100644 19/input.txt create mode 100644 19/test diff --git a/19/1.pl b/19/1.pl new file mode 100644 index 0000000..4b69c8a --- /dev/null +++ b/19/1.pl @@ -0,0 +1,56 @@ +use 5.20.0; + +use List::AllUtils qw/ first_index min max /; +use experimental qw/ postderef smartmatch /; + +my @grid = map { chomp; [ ' ', split '' ] } <>; + +my @c = ( 0, first_index { $_ eq '|' } $grid[0]->@* ); + +my @d = (1,0); + +use DDP; +p @c; +my $steps; + +my $safe = @grid * $grid[0]->@*; +while() { + die unless $safe--; + given( $grid[$c[0]][$c[1]] ) { + print $1 when /([A-Z])/; + + when( '+' ) { + @d = next_direction(); + } + } + $steps++; + last if $grid[$c[0]][$c[1]] eq 'T'; + $grid[$c[0]][$c[1]] = ' '; + @c = map { $c[$_] + $d[$_] } 0..1; + + last if min(@c) < 0; + last if max(@c) >= $grid[0]->@*; + # print_around(); +# print @$_ for @grid; + # my $x = ; + } + + say $steps; + +sub print_around { + for my $r ( max(0,$c[0]-5)..$c[0]+5 ) { + say join '', $grid[$r]->@[ max(0,$c[1]-5)..$c[1]+5 ] + } + my $x = ; + +} + +sub next_direction() { + for( [0,1], [0,-1] ) { + return @$_ if $grid[$c[0]+$_->[0]][$c[1] + $_->[1]] eq '-'; + } + for( [1,0], [-1,0] ) { + return @$_ if $grid[$c[0]+$_->[0]][$c[1] + $_->[1]] eq '|'; + } + die join ":", @c; +} diff --git a/19/input.txt b/19/input.txt new file mode 100644 index 0000000..b4826aa --- /dev/null +++ b/19/input.txt @@ -0,0 +1,201 @@ + | + +-----------------------+ +-------------------------------------------------------------------------------------------+ + | | | | | + +-------------------|-----------------------|-----------------------+ +-----------------------------------------------------------------------|-----+ | + | | | | | | | + +-----------+ | +---------------------------------|-------------------------+ | | | + | | | | | | | | | + | +-----+ | | | | +---------------------|---------------------------------------+ | | | + | | | | | | | | | | | | | + | | | | +---|-------+ +---------------------------|---------------------------------------------------------------------|-----|-------------+ + | | | | | | | | | | | | | + +-------|-------------------------------|-+ +-+ | | | +---------------------+ +-+ | +-----------------------+ +-------------+ + | | | | | | | | | | | | | | | | | | | | | + | +---|---------|-----------------------|---|---|---|---------------|-----------------+ | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | + | | | +-|-----+ | | | | | | | | +-------------------------------------|-----------------------------------------|-+ + | | | | | | | | | | | | | | | | | | | | | + | +-------------|-----------------------|---|---|----Y------|-------|-----------------------------------------------------------+ | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | +-----------------------------------------------------------|-----|-------------------|-+ | | + | | | | | | | | | | | | | | | | | | | | | | | + | | +---------------------------|-----------|---------------|-------------------------------------------------------------------------------------|-----------------+ | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | +---------------------------+ | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | + +-+ | | | | | | | | | | | | +-+ +-------------------------------------|-----------------------------------|-----+ | +-----+ | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | +-|-|-------------------|-------------|-|---------|---+ | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | +---|-+ | | | | | | | +-----|-------------|-----------|---|-------------------------------------------------------------|-|-----|-----------|-------|-|---+ | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | +-|---|---+ | | | | | | | | +-------|-----|-|---------|-------|-|-----+ | | | | | | | | +-|---+ | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | +-|---+ | +---------|---|-----|-------------------------------|-----------------------|-----------+ +-|-------|-|---+ | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | +-|---------------|-------|-----|-------------|-----|---------+ | | +-|---+ | +-------------------+ | +-------------------|---------|-+ | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | +-------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-------|---+ | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | +-|---|-|-------|-----------|-----|---------|-------|-------|-+ | | +-+ | | | | +-----------+ | | | +-+ | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | +-----------------|---|---|-|---+ | +-----------------------|-------+ +-+ | | +-|-|---|-|-------|-+ | | +-+ | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | +---|-----|-------------|---|-+ +-------|---------+ | | | | | | | | | | | | | | | | | | | | +-+ | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | +-|-|-----|---|-|-|-------------------------------------------|-----|-|-------+ | | | | +-----|---|---------+ | | +-----------|---------+ | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +-|---|-|-|-+ | +---|---|-------------------------+ | | | | | +---|-------|---|-+ +-|-|---|-|-----------|-----------|-----|-|-----|---|-|-----+ | +---|-----|---+ | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | +-----|-------------------+ | | | | +---|---------+ | | | | | | | | | | +-------|-|-----|-----|-------+ | | | +-+ | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | +---------------------|-+ | | | | | | +-----|---+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | +-|-|-----|---|---|-|-|-|-|-------------------+ | | | | | | | | | +-|-----+ | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | +-|---|---------------------------|-------------+ | +---+ | | | | | | | | | | | | | | +-----|-----------|-----|-------|---|---+ | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | +---------|-|-|-----------------------|-|-----------|---------------|-----|---|---------|---|-|---|-|-|-----|-----------|-------|---+ | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | E | | | | | | | | | | | | | | | + | | | | | | | | | | +-----|-----------|---|---------------------+ | | | | | | | | | | | | | | | | | | | | | | | | | | +-|---|-+ | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | +-|-------------|-|-|-----|----------U----|-|---|-------|-------------|-|-|---|---+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | +---------------|---------------------------|-----|---------|-----|-------------|-----------------+ | | | | | | | | | +-+ | +-|---|-----------------+ | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | +-|-----+ | +-|-+ +---------------|-|---+ | | | | | | | | | | | | | | | | | +-------|-----------------------|-|---|---|-|-----|---------|-|---------|---------+ T | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-------------+ | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | +-----------------------+ | | | | | +---+ | | +-|-----|---|-|-|-+ | | | | | +-------|---+ +-+ +-|-|-+ | | +---+ | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | +-----------|-----|-----------|-----|-----|-----------------|-|---|-------------|---|---|---|-----|---------|---------|-------|-----------+ | +---|-|-|-|-|---|---|-----+ | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | +---+ | | | | | +-|-----|-----|-------|---------|-+ | | | | | +---|-----|---------|---------|-------------+ | | | +-----------|---|-------|-----+ | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +---------|-----|-|-----|-------|-|-----------|-|-|-----|---|-------|-------|---|-|--D------|-|---|-------------|---------+ | +-------------|-|-----------------|-|---|-|-|-------|-------+ | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | +---------|---+ +-------|---|-------+ | | | | | | | | | | | | | | | +---|---------|---+ | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +---------------|---|-|-----|-----+ | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-------+ +-+ | +-|-----|-----|-----|-|-|-------|-|-------|-|-|-|---+ | | | +-+ | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | +-|-------|-------|-----------------------------------|-+ | | | | | | | | | | | | | +---------------|---|-|-----|-|-|-------|-|-------+ | | | | +-|-|---|-+ +-+ | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | +---|-|---------|-|---------|-|---|-|-----|-----|-|-|-----+ +---------+ | | | | | | | | | +---|-|-|-|-+ | | | +-----+ | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | +-------------|-|-----------------|-----------|-|-----|-----|-----|-|-----+ | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | +-----|-|-----+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +---------|---+ | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-|-+ | | + | | | | | | | | | | | | | | | | | | | | | | | | | I | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | +-|---------|-----|---------------------------+ | | | | | | | | | | | | | | | +-|-------+ | | | | | | | | | | | | | | | | | | +-+ | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | +-|---|-------|---|-----|-|-----|---------------|-----|-----|-----------|---|-----------|-|-----|-----|---------------|---------|-|-|-+ | | | +-------|-------+ | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | +---|-|-+ +---------+ | | +-------|-----|-----|---------------------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +-|-------|---+ | | | | | | | | +-----------------|-|---------------|---+ | | | | | | | +---|---|-----------|-|---+ | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | +---|---|-|-------------------------|-+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +-|-------|---|-----|-----|-----------|-------------------------|---|-+ | | | | | | | | | | | | | | | | | | +-----|-----------|---|---|---+ | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +-------------|-|-|-------|-----|-------|---------|---------|-------------------|-|---------+ +-|---|-----+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +-|-------------|---------|---|-|-----|-|-------------------|-|-----|-----|---------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | +-----------|---|---+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | +-----|---|-----------|-|-|---------|-----|-|-------------|---|-------+ | | | | | | | | | | | | | | | | | | | | +---------|-|-----------|---|-+ | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | +---------|-----|---|-|-----|-----|-----|-|-|-----|-+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | +-|-|---|---|---|-------|-----------|-|-+ +-|-|-----+ | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | +-----|-|-+ | | | | | | | | +-----------|---|-----|-|-------|-|---|-|N|-|-----|-------|-|-----------|---|-|-----|-+ | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | +-|-|-------|-|---|-------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-----+ | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +---|-------|---|-+ | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | +---|-----|-----------|-|-|-|-----|-|---|---|-+ | | | | | | | | | | +-|-|-|-+ | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | +---+ +---|-------|---------------|---|---|-------------------|-------------------|-|---|-|-|---|-|-------------------|-----|-----|-|---|---+ | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | +-----|---------------|-----------|---|-------|-----------------|-------|-------|-----------|-------|-+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | +-|---|---|-------------------|-----|-----|-----|-|-|-|-----------+ | | | | | | | +-|-|---+ | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | +-----|---------------|-------|---|---+ | | | | | | | +-----|-|-----|-|---|---|---|-|-|---------|---------|---------|---------+ | +-----------+ | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-|---------------|---|---|---|-|---------|-|---+ | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | +-------|-|-|-------|-------|---|---------|-------|-----------+ +-|---+ | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | +-------|---------|-----|---------|---------------------|-----|-----------|-|-----------|-+ | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | X | | | | | | | | | | | | + | | | | | | | | | +-----|-----|-|-|---------+ | | +-----------+ | | | | | | | | | | | | | | | +-----------+ +-|---+ | +-|-------|-+ | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | +-----------------|-|---+ | | | +-------|-|-------------|-------------|-----+ | | | | +-|---|-----|-+ | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +---------|-----------|-----------------|---|---|-----|-+ | | | | | | | | +-----|-|-|---|-------|-----|---------------|-----|-----|-|---|-----------|-----|---------|-----+ | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | +---+ | | | | | +---------------------|-----|-----|-|-------------|-----|-----|-|-----------|-|-|-|-|---|-------------|---------|-----+ | +-----------|---------|---|-----|-----|-|---|-+ | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | +---|---|-----|---|-----|-------|-------|-----------|---------------------------|-|-|---------------------|-|-|---------------------|---+ | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | +-------|-----|-----------------+ | +-+ | | | | | | | | +-|-|---|-+ | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | +-|-----|---+ | | | | | | | | | | +-|-|-------------|-|-----|---------+ | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | +-|-----+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-+ | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +-----|-|-|-------|---|---------|-------|---------|---|-----|-|-------------------|-------|-------------|-----|-|---------|-|---------------|---|-----------------|-------|-|---|-----------|---------+ + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +---------+ | | | | | | +-----|---|-----|-----|---|-|-------------------------|-|-|-----------|-|-----|---------|-----|-----------------|-----|-----|-|-------|-----------------|---------+ + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | +---|-|-----------|-|-|-----|---------|-----|-----------|---|-|---+ | | | | | | | +-----------|-+ | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | A | | | | | | | | | | | | | | | | | | | | | | | | | + +-----|-----|-|---|-+ | | | +---+ +-----|---|-------------------------+ | | | | | +---------|---------------|-----------|-----|-+ | | | | | | +-|-------------|-|-|-|---|---+ + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | +-----|-----------|-+ | | | | | | | | | | | +-+ | | | | | +---|---|---+ | | | | | +---+ + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | +-|-----|-|-------|-----------+ | | | | | | | | | | | | | | | | | | | | | | | | | +-+ | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | +-----|-|-----------|-+ | | | | | | | +-------|-|-------------|-----|-----|-----|---------------------|-|-------|---|-|---|---|---|-----|-----|---+ | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | | | | | +---|---+ | | | | | | +-|-|---+ | | +-+ | | | | | | | | +---|---|-|---|-------|-+ + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | +-------------|-+ | | +-|-----------------------------------+ | | | +---|-----+ | | | | | | | | | | | | +-|-----------+ | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +---|-|-------|-+ | | +---|-------+ | | | +---------------------------|-----------|---|-------|-----|-----|---------------------------------|-------------------+ | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | +-------|---+ +-------------+ +---+ +-|-|-------|-------------|-|---------------------------|-+ | | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + | +-------|---+ | | | | | | | | | | | +-+ +-------------------|-----+ +-+ +-----|-+ | +---+ | | + | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | | +-----|-------------------|---------|---|-------|-|---+ | | | | | | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | | | | | + +-+ +---|-----------|-----------------------------------------------------------------------|-------|-----------|-----|-----------------------------------+ | +-------------------+ +-|-+ + | | | | | | | | | | | | | | | | | | | | | | | | | P + | +-------|---------+ | | +-------------|-------------------------|---------|---|---------|-------------|-------------------------+ | +-----------------+ | | + | | | | | | | | | | | | | | | | | | | | | | | | | | + | | | | | | | | +-----------------------------|-----+ | +-------|-------------|---+ | +-----|---+ | | | | | + | | | | | | | | | | | | | | | | | | | | | | | | + | +---+ | +-|-------------+ | | | +---------+ +-------+ +-------------+ +---+ | | +---+ | + | | | | | | | | | | | | + +-----+ +-----+ +-+ +-----+ +-----------------------------------------------------------------------------------+ +-----------------+ + diff --git a/19/test b/19/test new file mode 100644 index 0000000..df3ff19 --- /dev/null +++ b/19/test @@ -0,0 +1,6 @@ + | + | +--+ + A | C + F---|----E|--+ + | | | D + +B-+ +--+