summary refs log tree commit diff stats
path: root/2020/day-12/input
blob: c64cbfdd348a62597ed29e266d4ab84d87183558 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174<
# This file is part of ranger, the console file manager.
# License: GNU GPL version 3, see the file "AUTHORS" for details.

NAME = ranger
VERSION = $(shell grep -m 1 -o '[0-9][0-9.]\+\S*' README.md)
NAME_RIFLE = rifle
VERSION_RIFLE = $(VERSION)
SNAPSHOT_NAME ?= $(NAME)-$(VERSION)-$(shell git rev-parse HEAD | cut -b 1-8).tar.gz
# Find suitable python version (need python >= 2.6 or 3.1):
PYTHON ?= $(shell \
	     (which python3) \
	     || (python -c 'import sys; sys.exit(sys.version < "2.6")' && \
	      which python) \
	     || (python2 -c 'import sys; sys.exit(sys.version < "2.6")' && \
	         which python2) \
	   )
ifeq ($(PYTHON),)
  $(error No suitable python found.)
endif
SETUPOPTS ?= '--record=install_log.txt'
DOCDIR ?= doc/pydoc
DESTDIR ?= /
PREFIX ?= /usr/local
PYOPTIMIZE ?= 1
FILTER ?= .

CWD = $(shell pwd)

default: test compile
	@echo 'Run `make options` for a list of all options'

options: help
	@echo
	@echo 'Options:'
	@echo 'PYTHON = $(PYTHON)'
	@echo 'PYOPTIMIZE = $(PYOPTIMIZE)'
	@echo 'DOCDIR = $(DOCDIR)'
	@echo 'DESTDIR = $(DESTDIR)'

help:
	@echo 'make:                 Test and compile ranger.'
	@echo 'make install:         Install $(NAME)'
	@echo 'make pypi_sdist:      Release a new sdist to PyPI'
	@echo 'make clean:           Remove the compiled files (*.pyc, *.pyo)'
	@echo 'make doc:             Create the pydoc documentation'
	@echo 'make cleandoc:        Remove the pydoc documentation'
	@echo 'make man:             Compile the manpage with "pod2man"'
	@echo 'make manhtml:         Compile the html manpage with "pod2html"'
	@echo 'make snapshot:        Create a tar.gz of the current git revision'
	@echo 'make test:            Test everything'
	@echo 'make test_pylint:     Test using pylint'
	@echo 'make test_flake8:     Test using flake8'
	@echo 'make test_doctest:    Test using doctest'
	@echo 'make test_pytest:     Test using pytest'
	@echo 'make test_other:      Verify the manpage is complete'
	@echo 'make test_py:         Run all python tests, including manpage completeness'
	@echo 'make test_shellcheck: Test using shellcheck'
	@echo 'make todo:            Look for TODO and XXX markers in the source code'

install:
	$(PYTHON) setup.py install $(SETUPOPTS) \
		'--prefix=$(PREFIX)' '--root=$(DESTDIR)' \
		--optimize=$(PYOPTIMIZE)

compile: clean
	PYTHONOPTIMIZE=$(PYOPTIMIZE) $(PYTHON) -m compileall -q ranger

clean:
	find ranger -regex .\*\.py[co]\$$ -delete
	find ranger -depth -name __pycache__ -type d -exec rm -r -- {} \;

doc: cleandoc
	mkdir -p $(DOCDIR)
	cd $(DOCDIR); \
		$(PYTHON) -c 'import pydoc, sys; \
		sys.path[0] = "$(CWD)"; \
		pydoc.writedocs("$(CWD)")'
	find . -name \*.html -exec sed -i 's|'"$(CWD)"'|../..|g' -- {} \;

TEST_PATHS_MAIN = \
	$(shell find ./ranger -mindepth 1 -maxdepth 1 -type d \
		! -name '__pycache__' \
		! -path './ranger/config' \
		! -path './ranger/data' \
	) \
	./ranger/__init__.py \
	$(shell find ./doc/tools ./examples -type f -name '*.py') \
	./ranger.py \
	./setup.py \
	./tests
TEST_PATH_CONFIG = ./ranger/config

test_pylint:
	@echo "Running pylint..."
	pylint $(TEST_PATHS_MAIN)
	pylint --rcfile=$(TEST_PATH_CONFIG)/.pylintrc $(TEST_PATH_CONFIG)

test_flake8:
	@echo "Running flake8..."
	flake8 $(TEST_PATHS_MAIN) $(TEST_PATH_CONFIG)

test_doctest:
	@echo "Running doctests..."
	@set -e; \
	for FILE in $(shell grep -IHm 1 doctest -r ranger | grep $(FILTER) | cut -d: -f1); do \
		echo "Testing $$FILE..."pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
R90
F58
S2
E4
F28
W3
N2
F25
E1
F24
W2
F91
S3
F83
L90
F24
R90
N3
R90
F5
W5
E1
S1
E5
F47
F83
N1
F64
W2
R90
S1
R180
N2
R180
S3
F35
E2
S3
W2
R270
F57
E5
F100
N3
L90
F70
E5
L90
F65
L90
S2
W5
F73
L90
E3
R90
W2
S2
L180
E4
W3
R90
E2
F18
N4
W5
R90
S1
F55
W2
L90
S1
L180
E4
N1
R90
F31
N5
E4
R90
W4
F18
W4
N2
L90
F6
N3
L180
F89
R90
N4
L180
S4
W1
F87
N1
F80
E4
R90
N4
F38
E5
F74
S4
R180
S1
L90
W1
F88
S1
F42
S1
R90
F2
R90
E2
S1
F57
E1
F53
R180
F97
W2
R90
F70
R180
W1
R180
W5
E5
N1
E5
F63
N3
F24
L90
S5
W5
R90
W4
F27
R90
E2
L180
E4
F16
L90
F47
S3
E1
S2
L90
W5
F80
E4
F10
N5
E3
N4
W2
L90
E1
F83
R180
S4
L90
E1
F94
N2
R90
S5
L180
E1
F40
E5
L180
W5
F57
E1
N5
W5
F62
L180
W3
F12
E4
F93
R270
F8
S3
W3
L90
W1
N1
E4
L90
E2
S2
E1
L270
E5
N5
F81
L90
W5
F82
E5
L90
F24
F3
F14
L180
N5
E1
F11
R90
F22
L90
S1
F82
S4
F38
L90
F31
R180
W4
F88
E3
R90
N5
F9
S3
W4
L90
W5
R90
F5
S4
F91
N4
S4
W4
S4
F78
N2
F67
L180
N3
R90
F65
N2
E1
F46
E2
L180
S4
E2
F98
L90
W2
N1
E3
F7
S4
F90
S2
W3
R90
F30
E4
F2
L90
F17
E4
R90
F94
N3
E5
R180
S4
F76
E2
F94
R90
N5
W2
F89
W1
F83
N5
W5
F62
S1
W4
N5
E2
R90
F14
R90
N5
W4
R180
E2
R90
L90
F67
N4
L90
E4
F93
W5
F85
L180
F45
W2
F78
N3
F90
L90
W1
S2
L90
S5
E5
F82
S4
F36
E5
L90
E1
F13
S2
E3
F65
L90
E3
E4
F1
W5
S3
F14
L90
F47
L90
S3
W4
F18
E1
N3
E5
F58
E5
S1
W2
F48
W5
F65
N5
E1
N3
R90
N2
L90
N4
F21
R90
F58
W1
F7
R90
E4
N5
F47
W4
L90
N4
R90
E1
L180
F8
E3
W4
F41
E3
S5
E5
S3
E3
F14
N4
R90
W3
L90
E5
R180
W4
S1
N2
F93
L90
F41
R180
F37
R90
E1
L180
N5
F96
W3
R90
E1
F88
S2
E2
L90
N2
W4
F34
E4
F69
L90
N3
F18
W3
S4
F44
E2
L90
N2
F55
R90
E1
L90
S5
E2
N3
L90
N1
F55
W5
N2
E2
F20
S2
W5
S1
W5
R180
F100
F44
S2
L90
E3
F98
N3
R90
W4
F14
N2
F87
W5
F12
L180
S2
W1
N1
W1
R90
L180
F64
E2
F41
L90
F20
R270
F91
N4
L180
F28
W4
F40
R90
F40
F36
E3
L270
F76
L90
N2
F15
N5
E4
L180
S1
R90
E1
F81
R90
F96
N1
E5
R90
S5
L90
S1
S4
R90
F30
E1
N5
E2
S3
F97
N3
R90
N1
R90
E3
R180
E3
F8
R90
W2
F27
L90
N5
W3
L90
E5
R180
S1
L90
F51
S4
L180
N1
W4
F71
W2
R90
E4
F29
E4
L90
L90
F68
W2
F57
E3
R90
S2
F94
W4
S2
L180
E3
N2
F52
E3
S1
S5
R90
E1
F35
W3
F53
R270
E3
F81
S2
L90
W4
F86
N5
E4
R90
N5
F99
L180
F65
R90
S2
W3
F33
E3
R270
F34
E1
F56
S2
E5
R180
N2
E3
N3
F30
N2
F22
E5
F10
N2
F16
N1
F31
R90
E2
F78
E4
R180
S3
R90
F80
E5
S1
F49
E1
S2
E4
N4
R90
F9
W1
E4
N3
N5
E4
L90
S5
E2
R90
F74
R180
N2
F98
S2
W4
W4
F73
E2
N4
E1
F25
S2
E5
L90
F96
N2
E3
N3
F16
S5
L90
F43
S2
R90
S1
F46
S3
F82
S5
S4
E5
F58
R90
F51
R90
N4
L90
W3
S4
R90
F15
E1
S4
W3
S2
W1
R90
F76
S1
L180
F5
R180
E1
L180
W3
F47
W4
F68
E5
F75
W3
N1
R90
S1
W5
R90
E2
F78
W2
L90
F24
W5
R90
F75
E1
F35
E5
R90
F57
L180
S1
L90
F90
R180
F63
S3
R180
W3
F79
N5
E4
F81
E3
F6
R90
E4
L90
W5
L180
W2
S4
F26
L90
E5
S3
L90
F3
L90
S2
R90
F55
W5
S1
E3
F63
L180
N2
E2
L90
S4
E3
F18
W4
N2
W5
R90
E5
L90
F96
N3
F7
N1
F87
R90
F53
R90
W5
S3
F94