-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2019.ijs
116 lines (114 loc) · 1.18 KB
/
2019.ijs
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
usage=: 0 : 0
Usage: jconsole 2019.ijs [-i] [<noun>]
Outputs value of <noun>. Solutions are nouns named in base 26, using the letters
of the alphabet. If a solution has several parts, the letter is followed by part
number, e.g. the solution for Day 1, Part 1, is named 'a1'.
Optionally, the '-i' flag can be provided to simply load this script into the
interpreter.
)
ai=: ".;._2 [ 0 : 0
110321
61817
107271
126609
84016
119187
53199
117553
83163
69434
62734
76774
75016
126859
114626
70782
102903
105871
108500
149367
99266
131731
86778
110561
116521
138216
55347
135516
126801
124902
103083
130858
54885
126837
71103
143975
135207
77264
149331
85252
78910
84007
123953
87355
113433
57750
78394
106081
110942
118180
71745
60080
56637
105491
111329
71799
59962
60597
75241
102506
75341
129539
71011
127185
51245
144401
78592
116835
52029
134905
80104
146304
113780
108124
131268
124765
78847
76897
56445
116487
62068
125176
122259
134261
101127
127089
55793
113113
132835
118901
59574
113399
73232
93720
144450
129604
101741
108759
55891
52939
)
a1=: +/ _2 + <. %&3 ai
a2=: +/ , }. |: (, _2 + {: <.@% 3:)^:(6<{:)^:_"0 ai
out=: <@'usage'^:(0=#) (#~ 0 = 4!:0) ARGV
(exit@0: echo@".@>@out)^:(-.@e.~ <@'-i') ARGV