aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-12-20 19:31:13 +0100
committerLeah Neukirchen <leah@vuxu.org>2017-12-20 19:31:13 +0100
commitf6ecf88a2d9da1f140abedc52a0b9b46108a6563 (patch)
treefa336b0f152d821c3e58249b891aee2fc57e88ea
parent868e907bdec033e993e02a6208d6ec6c96402e4f (diff)
downloadadventofcode2017-f6ecf88a2d9da1f140abedc52a0b9b46108a6563.tar.gz
adventofcode2017-f6ecf88a2d9da1f140abedc52a0b9b46108a6563.tar.xz
adventofcode2017-f6ecf88a2d9da1f140abedc52a0b9b46108a6563.zip
day19
-rw-r--r--day19201
-rw-r--r--day19.cc37
-rw-r--r--day19.k6
3 files changed, 244 insertions, 0 deletions
diff --git a/day19 b/day19
new file mode 100644
index 0000000..99c6fe6
--- /dev/null
+++ b/day19
@@ -0,0 +1,201 @@
+ |
+ | +---------------------------------------------------------------------------------------------------------------------------------------------------------------+
+ | | |
+ | +-------------------------------------------+ +-------------+ +---------------+ +-------------------------------------+
+ | | | | | | | | |
+ | +-----------------------------|---------+ | +-+ +-------+ +---+ | | | +-----------|-----------------------------------------+ +-----------+
+ | | | | | | | | | | | | | | | | | | |
+ | | +---|---|---|-------------------------------|---|-------|-------------|---|---------------|---------------------------------------------+ |
+ | | | | | | | | | | | | | | | | |
+ | +-----------------+ | +---------|--------------------------B----------+ +-------------|---|---|-----------|---------------------|---------------+ | +---+ +-+ |
+ | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | +-|---------|-------+ | +---------------------------------------+ | | +-|---|-------+ |
+ | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | +---------|-|---------------|---------+ | +-----|-------+ | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | +---------|-------------|-----|-|-------+ | +-----|-----|-------------------+ | +-------------------+ | +---------------------|-----|-------+
+ | | | | | | | | | | | | | | | | | | | | | | |
+ | +---------------------------------------+ | +-|-+ | | | | +-+ +-------|-|-|-+ | | | | | | | +-+ |
+ | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | +-|-----|-|-+ | +---------|-----|-----------|---|---+ +-|-|-----+ +-|-+ +---------+ +-------+ | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | +---|-----|---------|-----|-----|---------|---|-|-|-|---|-|-----|-|-|-----------------------------|-------+ | | | +---+ | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | +---------------------------------|---------|---|---|-|-------------|-------------------|-----------+ +---------|-|-+ | | +-+ | | +-------------+ | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | +-+ +-+ | | | | | | | +-----------|-----+ | | +-----------|---+ | | | +---|-+ | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | +-------------------------|---------|-|-----|---|---------------|-----|---------|-----|---------------|-------|-------------|---+ | | | +---|---|-|-|-------|-+ |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | +---+ +-------------------------------+ +-|-+ | | | | | | | | | | | +-----+ | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | +---|---|-----------------|-----------|-------------------|-----------------|-------------|-----------------------------|-----------------|---|-|-+ | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | +-+ +-------------|---------|-|---|-------+ | | | | | | +-----|-----------------------------------|-|-+ +-------|---------|-----|---|---------+ | +-----+ | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | +---------|---|-----+ | +-|-------------|-----+ | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ +---------------------------------------------|---|-|-+ | | | | | | +-------------+ | | | +-----|-|-|-------|-------|---------------|---|-------------+ | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | +---------------+ +-------|---|-|-+ | | | | +---|---|-----|-----|---|---|-------------------------------|---------|-|-----|-+ | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | +-|-------|-----|-----------|-------|-|---|-------------------|-|---------|-----|-------|-----------|-|-|-|-----------------------|-----|---+ | | | | | +-----+ |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | +-+ | +-|---+ | | +-------+ | | | | | | | | | | | | | | | | +---+
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | +-|---------------------|-------|-+ | | | | | +-------|-|-------------------------+ | +-----|---------------------+ +---+ +-------|-----+ | +-----|-------------|---------|-|---+ +---+
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | +-|-----|-------|-----+ | | | | +---------------|-|-----------|---+ +-----|-----+ +---|-------------------------|---|---|-|-|-|---+ | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | +-----------------|-----|---|-----------|-------|-----|---+ | +-+ | | | | | | | | | | | | | +-|-+
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | +---+ | | | | +---------------------------------------|-----|-|-------|---|-----------------------|-|---|-------------------|-----------|-+ | +---+
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | +-+ | | | | | | | | | +---|-|-+ | | | +-------|---------|-----------------|-------------|-----------|-----------|-----------|-----|-----------|-+ | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | +-------|---------|---|-----|-----|-|-|---|-----------|-------|-------------+ | +-----|-------|-+ | | | | | | | | | | | +---|---|-|-|-|-|---------+
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | +---------|-|-----|---------------|-|-------|---|-------------------------|-----|-|-|---|---|-------------|-------------|-----+ | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | +-------------|-----|-|-----+ | | | | | | | | | | | | | | | | | | +-----|-|-|---+ | | | | | | +---|---|---|-----+ | +-+ |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | +-------|-|-----------|-------------|---|-|-----------------------|---+ | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | +---|-----|-----|-----|-|-----|---|-------------|-----------|-|---|-|-------------|-+ | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | +-----|-------------------------------|---|-|-----------------|---|---|---------|-----|-----|-----|-|-|-----|-|-|-------------+ | | | | | +-|-|-|---|---|-|-------+ |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | +-|---------------|-----|---------|-----|-|-|-------------|---------|U|---------------+ | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | +-+ | | | | | | | +-|---|-------------|-+ | | +---|---------|-|-----|-+ | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | +-----|-------|-----|-------------|---|---|-|-----------|-----------------------|-----|---------------------|-|-------------|-----------|-|-+ | | | | | | | | | | | | +-----+ | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | +-|-----|---------|-|---------------|-|---------------|---|-----+ | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | +---------+ | | | | | +-----|-------+ | | | | +-----------------------------------|-|---------------+ | | +---|-|-+ +-+ | | | +-------|-|-|-|---|-|-|-+ | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-----+ | | | +---+ | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | +-------+ | | | | | | +-|-|-------|-----|-|---------|-----------|-+ | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | +-----|---|---|-|-----|-----|-----------------------------------|-----|-----------------|---------|-------|---------|-----+ +-------+ | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | +-------------|-|-----|-----|---|-|-|---+ | | +-|-----------------------|---|-|---------|-----|---|-|---|---------|-------------|---------|-+ | | +-----|-----|---|---|---+
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ +-|-----|-------|---------------------|-----|---|-|---|-------|-----------|-|---------------------|-|-----|-----|-|-|-----|-|-|-----|-----|---|-------+ | | +-----|-|-----|---|---|---|-|---|---+ | |
+ | | | | | | | | | O | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +---|-----|-S | | | | | +-+ | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | +---|-|---|-|---------------|-|-|-------|---+ +-|-------|-----|-------|---+ | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | +-------|---|---|-------|-------|-----------------------|-|-------------------------|---------+ | | | | | | +-+ | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | +-----|-------|-------|-----+ | | | +-|-|-----|-----|---|---+ | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | +-|---|---|-----------|-------|-----|-----|-|---------------|-----|-|-|-------------------|-|-|---------+ | | | | | | | | | | | +-------------|-+ | | | | | | +---+ | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +---|---|-+ | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-----------|-+ | | | | | +---|---+ | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | +-|---------------|-|-----------|-----|-----|---|-----|-------|-------------+ | +-------|-+ | | | | | | | | | | | | +---------|---|-----------|-----|---------|---|-------|-+
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-|-|-+ | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | +-|-|-------|-----|---|---------|-|-----------+ | | | | | | | | +---|---|-|-|-|-------|---------|---|---|-+ +-+ | +---|-------+ | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | +-------------------|-------|-------|-----------|---|-|-----------------|-----------|-------|-----|-+ +-------|-|---|-------------------------|---|-------------|-|---------|-+
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | +---------------------------|---|-----|-----------------|---|-|-|-|---|-------------|-|---------|-+ | | | | | | | | +-|-----|-----------|-------|---|-----|---|-+ | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | +---|---------------------------|-------------|-------------------|-|-|-|---------+ +-----|-----------|-----|-|-|---|-------------|-|-------+ | | | | | | | | +-----------+ | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | +-----|-----|---|---|---+ | | | | | +-------|-----|-----------|---------------|-------|---|-------------------|-+ | | | | | | | | | +-|-----|---|-|---|-|-+ | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | +-+ | | | | | | | | | | | | | | | | | | | | | | | | +-------|-|-|---|-----------|---|---|---|-----|-----|-|---------|-----------|-|-|-|-+ | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | +---|---------|---+ | | | | | | | | | | | | +-----|-|-+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | +---------|-----|-|-----------------|-------|-------------------|-|---|---|-|---|-------+ | | | | | +-|---|-+ | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | +-----|-----------------|---|-|---|---|---------+ | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | +-------+ | | | | | | | | | | | +-|-|-------+ +-------------|---+ | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-------+ | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | +---------------------|-|-----|-|-----------------|-----|-------------+ | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-|-----|-+
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | +-----|-+ | +-------------|-----------|-----------------+ | +-|-|---|-----------+ | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | +---|---|-------|---------------|---+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | +-|-|---|---|-------|---|-------|-----+ | | +---+ | | +---|---------|---------------------+ | | | | | | | | | | +-------|-|---|-|-|-|-+
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | +-+ | | | | | | | | | +-+ | | | | | | | | +---------|-------|-|-----------|-|-----------|---|---|-----|---|-----+ +---|---------|-------|-----|-+
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | +-------------|-|-------|-------------|-|-+ +---|---|-------|-----|---------|---+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | +-|---|---------------|-------|-------|-----------------|---|-----+ | | | +---------|---------|-------------|-------|---------------+ | +-+ | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | +-|---------|---+ | | | | | | | | | | | | | | +---------|---------------------------|-----|---------------|---------------------|-|-|---+ | | +-+ | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | +-|-------------|-----------------|-|-------------|-+ | | | | | +-----|-------|-----|-----|-|-------|-----|-|-------+ | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | +-|-----|-|-----|-------------------+ | | | +-+ | | | | | | | | | +-----+ | | | | | | | | +---|---|-|---|-+ | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ +-----------------|---+ +-----+ | | | | | +---|---|-----------|-|---------------|-----|-----|-------------|-|-------------------+ | | | | | | | | | | +-|---|-+ | +-+ | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-------|-----|---+
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ +-|-------------------------------|-------|---------|-------------|-|---|-----------+ | | | | | | | +---------------------------|---------------|-------|-|---------+ +---|---|-|-|-|-+
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | +---|-----------------+ | | | | | | | | +-|---|---------------|-----|-|-----|---------|---------|-+ | | | | | | | +---|---|---|---|-------------+
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | E | | | | | | | | | | | | | | | |
+ | | | | | | +-----+ | | | | | +-------|-|-|-------------|---|---------|-------|-----|-----|-------|-----+ | | | | | | | | | | +-|---|-|-|-|-+ | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | +-|-----|-----|-------|-|-----------------|-|-----------|-----+ | +---|-------|-----|-------|-----+ | +---|-------------|-------------|-------|-----------|---+ |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | +---|-+ | | | | | | | | | | | | +-|-------------|-|-----------+ | | | | +-------------------|-+ +---------------|---------|-|-|-|---------|-----+ | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | +-|-|-----|---------------------+ | | | | | +---------------+ | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | +-------|-|---------|-----|---|-|-|-|---+ +-|-+ |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ +-------+ | | | | | | +---|-|-------------|-----|-----------------------|---------------------+ | | | +-----------|-------------|---------|-|-|-|-------|-----+ | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | +-------|-----------+ | | | | | | | | | | | | +-----------|-|-----------|---|-------|-----------|---------|-|-|---------|-+ | | +-|-|-|---|-|-+ +-+
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | +-------+ +---------------------|---|-|-|---------|------M------------+ +-|-----------------------|---------------|-|-----|-|-|--W--------+
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | +-----------------------------------+ | | | | | | | | | +---|-------------------+ | +-----------|-----------|-------------+ +---|-------+
+ | | Q | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | +-------------|-------|-------------|-------------+ | | | | | | | | +---|-------|---------------|---|-------------|-|-------------------+
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | +---+ | | | | | | | | | | | | +---|-----------------|-----------------------|---|---------|---|-+ | | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | +---------+ | | | | | | | +-----------|-----|---|-----+ +---------------|-------------+ | | +---+ | | |
+ | | | | | | | | | | | | | | | | | | | | | | | | | |
+ | | +-------------------+ | +-----|-|-----------|-|-------------|-----|---|-----+ +-----------|-|-|-----------------------|-----|-+ +-+
+ | | | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | +-|---|---------+ | | | +-------|-----------+ +-----------------+ +-------|-|---+ +-+ |
+ | | | | | | | | | | | | | | | | | | | | | | | |
+ | | +------A----------------------------------|---------------------------------+ | | +---------------|-------|---------------------+ | +-|---+ +-|-----+ | |
+ | | | | | | | | | | | | | | | | | | | | | |
+ | | | | | | | | | | | +---+ +-------------+ +-+ +-----------+ | +-+ |
+ | | | | | | | | | | | | | |
+ +-------------+ +-----------------------------------------+ +-+ +---+ +-----------------+ +-------------------------------------------------+ +---------+
+
diff --git a/day19.cc b/day19.cc
new file mode 100644
index 0000000..79a2c34
--- /dev/null
+++ b/day19.cc
@@ -0,0 +1,37 @@
+#include <string>
+#include <vector>
+#include <iostream>
+
+using namespace std;
+
+int
+main()
+{
+ vector<string> d;
+
+ for (string l; getline(cin, l); )
+ d.push_back(l);
+
+ int y = 0;
+ int x = d[y].find('|');
+
+ string p1;
+ int p2 = 0;
+
+ for (int dx = 0, dy = 1; d[y][x] != ' '; x += dx, y += dy, p2++) {
+ if (isupper(d[y][x]))
+ p1.push_back(d[y][x]);
+
+ if (d[y][x] == '+') {
+ if (dx) {
+ dx = 0;
+ dy = (d[y+1][x] != ' ') ? 1 : -1;
+ } else {
+ dx = (d[y][x+1] != ' ') ? 1 : -1;
+ dy = 0;
+ }
+ }
+ }
+
+ cout << p1 << endl << p2 << endl;
+}
diff --git a/day19.k b/day19.k
new file mode 100644
index 0000000..db9b036
--- /dev/null
+++ b/day19.k
@@ -0,0 +1,6 @@
+s:" "~(d:0:"day19").
+v:*:'{~s@*x}{(h+*x;h:$["+"~d .*x;$[*|*|x;|0,1 -1@s 1 0+*x;0,1 -1@s 0 1+*x];*|x])}\(0,(*d)?"|";1 0)
+
+{~(x<"A")|x>"Z"}#d ./:v
+-1+#v
+\\