advent_of_ruby 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/arb +1 -1
- data/data/solutions/reddit/ruby/2015/02.yml +5 -5
- data/data/solutions/reddit/ruby/2015/03.yml +6 -6
- data/data/solutions/reddit/ruby/2015/04.yml +7 -7
- data/data/solutions/reddit/ruby/2015/05.yml +6 -6
- data/data/solutions/reddit/ruby/2015/06.yml +14 -14
- data/data/solutions/reddit/ruby/2015/07.yml +15 -15
- data/data/solutions/reddit/ruby/2015/08.yml +6 -6
- data/data/solutions/reddit/ruby/2015/09.yml +11 -11
- data/data/solutions/reddit/ruby/2015/10.yml +18 -18
- data/data/solutions/reddit/ruby/2015/11.yml +19 -19
- data/data/solutions/reddit/ruby/2015/12.yml +10 -10
- data/data/solutions/reddit/ruby/2015/13.yml +9 -9
- data/data/solutions/reddit/ruby/2015/14.yml +11 -11
- data/data/solutions/reddit/ruby/2015/15.yml +9 -9
- data/data/solutions/reddit/ruby/2015/16.yml +7 -7
- data/data/solutions/reddit/ruby/2015/17.yml +10 -10
- data/data/solutions/reddit/ruby/2015/18.yml +4 -4
- data/data/solutions/reddit/ruby/2015/19.yml +1 -1
- data/data/solutions/reddit/ruby/2015/20.yml +2 -2
- data/data/solutions/reddit/ruby/2015/21.yml +4 -4
- data/data/solutions/reddit/ruby/2015/22.yml +5 -5
- data/data/solutions/reddit/ruby/2015/23.yml +3 -3
- data/data/solutions/reddit/ruby/2015/24.yml +11 -11
- data/data/solutions/reddit/ruby/2015/25.yml +5 -5
- data/data/solutions/reddit/ruby/2016/01.yml +5 -5
- data/data/solutions/reddit/ruby/2016/02.yml +3 -3
- data/data/solutions/reddit/ruby/2016/03.yml +1 -1
- data/data/solutions/reddit/ruby/2016/04.yml +4 -4
- data/data/solutions/reddit/ruby/2016/05.yml +3 -3
- data/data/solutions/reddit/ruby/2016/06.yml +4 -4
- data/data/solutions/reddit/ruby/2016/07.yml +3 -3
- data/data/solutions/reddit/ruby/2016/08.yml +6 -6
- data/data/solutions/reddit/ruby/2016/09.yml +1 -1
- data/data/solutions/reddit/ruby/2016/10.yml +3 -3
- data/data/solutions/reddit/ruby/2016/11.yml +1 -1
- data/data/solutions/reddit/ruby/2016/12.yml +3 -3
- data/data/solutions/reddit/ruby/2016/14.yml +4 -4
- data/data/solutions/reddit/ruby/2016/15.yml +11 -11
- data/data/solutions/reddit/ruby/2016/16.yml +1 -1
- data/data/solutions/reddit/ruby/2016/17.yml +3 -3
- data/data/solutions/reddit/ruby/2016/18.yml +3 -3
- data/data/solutions/reddit/ruby/2016/20.yml +2 -2
- data/data/solutions/reddit/ruby/2016/21.yml +7 -7
- data/data/solutions/reddit/ruby/2016/22.yml +10 -10
- data/data/solutions/reddit/ruby/2017/01.yml +7 -7
- data/data/solutions/reddit/ruby/2017/02.yml +15 -15
- data/data/solutions/reddit/ruby/2017/03.yml +9 -9
- data/data/solutions/reddit/ruby/2017/04.yml +4 -4
- data/data/solutions/reddit/ruby/2017/05.yml +12 -12
- data/data/solutions/reddit/ruby/2017/06.yml +16 -16
- data/data/solutions/reddit/ruby/2017/07.yml +5 -5
- data/data/solutions/reddit/ruby/2017/08.yml +18 -18
- data/data/solutions/reddit/ruby/2017/09.yml +7 -7
- data/data/solutions/reddit/ruby/2017/10.yml +9 -9
- data/data/solutions/reddit/ruby/2017/11.yml +1 -1
- data/data/solutions/reddit/ruby/2017/12.yml +6 -6
- data/data/solutions/reddit/ruby/2017/13.yml +6 -6
- data/data/solutions/reddit/ruby/2017/14.yml +1 -1
- data/data/solutions/reddit/ruby/2017/15.yml +3 -3
- data/data/solutions/reddit/ruby/2017/16.yml +5 -5
- data/data/solutions/reddit/ruby/2017/17.yml +6 -6
- data/data/solutions/reddit/ruby/2017/18.yml +7 -7
- data/data/solutions/reddit/ruby/2017/19.yml +2 -2
- data/data/solutions/reddit/ruby/2017/20.yml +5 -5
- data/data/solutions/reddit/ruby/2017/21.yml +11 -11
- data/data/solutions/reddit/ruby/2017/22.yml +1 -1
- data/data/solutions/reddit/ruby/2017/23.yml +1 -1
- data/data/solutions/reddit/ruby/2017/25.yml +3 -3
- data/data/solutions/reddit/ruby/2018/01.yml +20 -20
- data/data/solutions/reddit/ruby/2018/02.yml +16 -16
- data/data/solutions/reddit/ruby/2018/03.yml +12 -12
- data/data/solutions/reddit/ruby/2018/04.yml +6 -6
- data/data/solutions/reddit/ruby/2018/05.yml +15 -15
- data/data/solutions/reddit/ruby/2018/06.yml +4 -4
- data/data/solutions/reddit/ruby/2018/07.yml +11 -11
- data/data/solutions/reddit/ruby/2018/08.yml +9 -9
- data/data/solutions/reddit/ruby/2018/09.yml +13 -13
- data/data/solutions/reddit/ruby/2018/10.yml +10 -10
- data/data/solutions/reddit/ruby/2018/11.yml +9 -9
- data/data/solutions/reddit/ruby/2018/12.yml +2 -2
- data/data/solutions/reddit/ruby/2018/13.yml +14 -14
- data/data/solutions/reddit/ruby/2018/14.yml +5 -5
- data/data/solutions/reddit/ruby/2018/15.yml +2 -2
- data/data/solutions/reddit/ruby/2018/16.yml +7 -7
- data/data/solutions/reddit/ruby/2018/17.yml +1 -1
- data/data/solutions/reddit/ruby/2018/18.yml +6 -6
- data/data/solutions/reddit/ruby/2018/19.yml +1 -1
- data/data/solutions/reddit/ruby/2018/20.yml +1 -1
- data/data/solutions/reddit/ruby/2018/21.yml +4 -4
- data/data/solutions/reddit/ruby/2018/22.yml +3 -3
- data/data/solutions/reddit/ruby/2018/23.yml +11 -11
- data/data/solutions/reddit/ruby/2018/24.yml +4 -4
- data/data/solutions/reddit/ruby/2018/25.yml +6 -6
- data/data/solutions/reddit/ruby/2019/01.yml +11 -11
- data/data/solutions/reddit/ruby/2019/02.yml +13 -13
- data/data/solutions/reddit/ruby/2019/03.yml +7 -7
- data/data/solutions/reddit/ruby/2019/04.yml +11 -11
- data/data/solutions/reddit/ruby/2019/05.yml +10 -10
- data/data/solutions/reddit/ruby/2019/06.yml +7 -7
- data/data/solutions/reddit/ruby/2019/07.yml +8 -8
- data/data/solutions/reddit/ruby/2019/08.yml +8 -8
- data/data/solutions/reddit/ruby/2019/09.yml +4 -4
- data/data/solutions/reddit/ruby/2019/10.yml +4 -4
- data/data/solutions/reddit/ruby/2019/11.yml +7 -7
- data/data/solutions/reddit/ruby/2019/12.yml +17 -17
- data/data/solutions/reddit/ruby/2019/13.yml +6 -6
- data/data/solutions/reddit/ruby/2019/14.yml +2 -2
- data/data/solutions/reddit/ruby/2019/15.yml +3 -3
- data/data/solutions/reddit/ruby/2019/16.yml +6 -6
- data/data/solutions/reddit/ruby/2019/17.yml +3 -3
- data/data/solutions/reddit/ruby/2019/18.yml +1 -1
- data/data/solutions/reddit/ruby/2019/20.yml +9 -9
- data/data/solutions/reddit/ruby/2019/21.yml +3 -3
- data/data/solutions/reddit/ruby/2019/22.yml +3 -3
- data/data/solutions/reddit/ruby/2019/23.yml +1 -1
- data/data/solutions/reddit/ruby/2019/25.yml +2 -2
- data/data/solutions/reddit/ruby/2020/01.yml +30 -30
- data/data/solutions/reddit/ruby/2020/02.yml +25 -25
- data/data/solutions/reddit/ruby/2020/03.yml +17 -17
- data/data/solutions/reddit/ruby/2020/04.yml +26 -26
- data/data/solutions/reddit/ruby/2020/05.yml +35 -35
- data/data/solutions/reddit/ruby/2020/06.yml +40 -40
- data/data/solutions/reddit/ruby/2020/07.yml +16 -16
- data/data/solutions/reddit/ruby/2020/08.yml +13 -13
- data/data/solutions/reddit/ruby/2020/09.yml +21 -21
- data/data/solutions/reddit/ruby/2020/10.yml +29 -29
- data/data/solutions/reddit/ruby/2020/11.yml +8 -8
- data/data/solutions/reddit/ruby/2020/12.yml +22 -22
- data/data/solutions/reddit/ruby/2020/13.yml +15 -15
- data/data/solutions/reddit/ruby/2020/14.yml +11 -11
- data/data/solutions/reddit/ruby/2020/15.yml +9 -9
- data/data/solutions/reddit/ruby/2020/16.yml +13 -13
- data/data/solutions/reddit/ruby/2020/17.yml +11 -11
- data/data/solutions/reddit/ruby/2020/18.yml +19 -19
- data/data/solutions/reddit/ruby/2020/19.yml +18 -18
- data/data/solutions/reddit/ruby/2020/20.yml +4 -4
- data/data/solutions/reddit/ruby/2020/21.yml +4 -4
- data/data/solutions/reddit/ruby/2020/22.yml +8 -8
- data/data/solutions/reddit/ruby/2020/23.yml +4 -4
- data/data/solutions/reddit/ruby/2020/24.yml +6 -6
- data/data/solutions/reddit/ruby/2020/25.yml +6 -6
- data/data/solutions/reddit/ruby/2021/01.yml +74 -74
- data/data/solutions/reddit/ruby/2021/02.yml +45 -45
- data/data/solutions/reddit/ruby/2021/03.yml +43 -43
- data/data/solutions/reddit/ruby/2021/04.yml +23 -23
- data/data/solutions/reddit/ruby/2021/05.yml +16 -16
- data/data/solutions/reddit/ruby/2021/06.yml +35 -35
- data/data/solutions/reddit/ruby/2021/07.yml +26 -26
- data/data/solutions/reddit/ruby/2021/08.yml +15 -15
- data/data/solutions/reddit/ruby/2021/09.yml +11 -11
- data/data/solutions/reddit/ruby/2021/10.yml +9 -9
- data/data/solutions/reddit/ruby/2021/11.yml +12 -12
- data/data/solutions/reddit/ruby/2021/12.yml +8 -8
- data/data/solutions/reddit/ruby/2021/13.yml +13 -13
- data/data/solutions/reddit/ruby/2021/14.yml +10 -10
- data/data/solutions/reddit/ruby/2021/15.yml +10 -10
- data/data/solutions/reddit/ruby/2021/16.yml +8 -8
- data/data/solutions/reddit/ruby/2021/17.yml +6 -6
- data/data/solutions/reddit/ruby/2021/18.yml +5 -5
- data/data/solutions/reddit/ruby/2021/19.yml +3 -3
- data/data/solutions/reddit/ruby/2021/20.yml +5 -5
- data/data/solutions/reddit/ruby/2021/21.yml +5 -5
- data/data/solutions/reddit/ruby/2021/22.yml +4 -4
- data/data/solutions/reddit/ruby/2021/23.yml +7 -7
- data/data/solutions/reddit/ruby/2021/24.yml +8 -8
- data/data/solutions/reddit/ruby/2021/25.yml +4 -4
- data/data/solutions/reddit/ruby/2022/01.yml +29 -29
- data/data/solutions/reddit/ruby/2022/02.yml +21 -21
- data/data/solutions/reddit/ruby/2022/03.yml +35 -35
- data/data/solutions/reddit/ruby/2022/04.yml +42 -42
- data/data/solutions/reddit/ruby/2022/05.yml +29 -29
- data/data/solutions/reddit/ruby/2022/06.yml +38 -38
- data/data/solutions/reddit/ruby/2022/07.yml +25 -25
- data/data/solutions/reddit/ruby/2022/08.yml +9 -9
- data/data/solutions/reddit/ruby/2022/09.yml +18 -18
- data/data/solutions/reddit/ruby/2022/10.yml +14 -14
- data/data/solutions/reddit/ruby/2022/11.yml +7 -7
- data/data/solutions/reddit/ruby/2022/12.yml +2 -2
- data/data/solutions/reddit/ruby/2022/13.yml +9 -9
- data/data/solutions/reddit/ruby/2022/14.yml +5 -5
- data/data/solutions/reddit/ruby/2022/15.yml +6 -6
- data/data/solutions/reddit/ruby/2022/16.yml +5 -5
- data/data/solutions/reddit/ruby/2022/17.yml +2 -2
- data/data/solutions/reddit/ruby/2022/18.yml +6 -6
- data/data/solutions/reddit/ruby/2022/19.yml +3 -3
- data/data/solutions/reddit/ruby/2022/20.yml +12 -12
- data/data/solutions/reddit/ruby/2022/21.yml +11 -11
- data/data/solutions/reddit/ruby/2022/22.yml +4 -4
- data/data/solutions/reddit/ruby/2022/24.yml +10 -10
- data/data/solutions/reddit/ruby/2022/25.yml +10 -10
- data/data/solutions/reddit/ruby/2023/01.yml +52 -52
- data/data/solutions/reddit/ruby/2023/02.yml +21 -21
- data/data/solutions/reddit/ruby/2023/03.yml +18 -18
- data/data/solutions/reddit/ruby/2023/04.yml +31 -31
- data/data/solutions/reddit/ruby/2023/05.yml +14 -14
- data/data/solutions/reddit/ruby/2023/06.yml +24 -24
- data/data/solutions/reddit/ruby/2023/07.yml +32 -32
- data/data/solutions/reddit/ruby/2023/08.yml +20 -20
- data/data/solutions/reddit/ruby/2023/09.yml +32 -32
- data/data/solutions/reddit/ruby/2023/10.yml +18 -18
- data/data/solutions/reddit/ruby/2023/11.yml +16 -16
- data/data/solutions/reddit/ruby/2023/12.yml +5 -5
- data/data/solutions/reddit/ruby/2023/13.yml +6 -6
- data/data/solutions/reddit/ruby/2023/14.yml +14 -14
- data/data/solutions/reddit/ruby/2023/15.yml +13 -13
- data/data/solutions/reddit/ruby/2023/16.yml +8 -8
- data/data/solutions/reddit/ruby/2023/18.yml +5 -5
- data/data/solutions/reddit/ruby/2023/19.yml +6 -6
- data/data/solutions/reddit/ruby/2023/20.yml +9 -9
- data/data/solutions/reddit/ruby/2023/21.yml +5 -5
- data/data/solutions/reddit/ruby/2023/22.yml +2 -2
- data/data/solutions/reddit/ruby/2023/23.yml +1 -1
- data/data/solutions/reddit/ruby/2023/25.yml +1 -1
- data/data/solutions/reddit/ruby/2024/01.yml +15 -15
- data/data/solutions/reddit/ruby/2024/02.yml +17 -17
- data/data/solutions/reddit/ruby/2024/03.yml +43 -43
- data/data/solutions/reddit/ruby/2024/04.yml +18 -18
- data/data/solutions/reddit/ruby/2024/05.yml +29 -29
- data/data/solutions/reddit/ruby/2024/06.yml +19 -19
- data/data/solutions/reddit/ruby/2024/07.yml +26 -26
- data/data/solutions/reddit/ruby/2024/08.yml +15 -15
- data/data/solutions/reddit/ruby/2024/09.yml +5 -5
- data/data/solutions/reddit/ruby/2024/10.yml +9 -9
- data/data/solutions/reddit/ruby/2024/11.yml +15 -15
- data/data/solutions/reddit/ruby/2024/12.yml +9 -9
- data/data/solutions/reddit/ruby/2024/13.yml +10 -10
- data/data/solutions/reddit/ruby/2024/14.yml +6 -6
- data/data/solutions/reddit/ruby/2024/15.yml +5 -5
- data/data/solutions/reddit/ruby/2024/16.yml +4 -4
- data/data/solutions/reddit/ruby/2024/17.yml +11 -11
- data/data/solutions/reddit/ruby/2024/18.yml +9 -9
- data/data/solutions/reddit/ruby/2024/19.yml +16 -16
- data/data/solutions/reddit/ruby/2024/20.yml +8 -8
- data/data/solutions/reddit/ruby/2024/21.yml +3 -3
- data/data/solutions/reddit/ruby/2024/22.yml +8 -8
- data/data/solutions/reddit/ruby/2024/23.yml +13 -13
- data/data/solutions/reddit/ruby/2024/24.yml +7 -7
- data/data/solutions/reddit/ruby/2024/25.yml +14 -14
- data/lib/arb/api/aoc.rb +2 -2
- data/lib/arb/cli/run.rb +2 -3
- data/lib/arb/version.rb +1 -1
- data/lib/download_solutions/api/reddit/get_serial_comments.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ced52377239ccf4263bbca0ee7711f31640d41bc48938285f899fea20349c26
|
4
|
+
data.tar.gz: fe2692a5d8966673315d9c24a51ada3b37e84b11b18485d97298e6526eec2db6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 186f0d35ac1fa7654711f66db97973559286990de4271d600e455f516d00b7cd4b70dd6275194e245aa5211d4a0f7f3fd32ecf482ed699cd54fe4df069372a01
|
7
|
+
data.tar.gz: efb48cc15cfa78e6f880cb783c9e2a6b426d7e387aa292ec607ce7b6a713d6843be876ba5542d8fc9636fbb3cb810a4a64c3983052038dc0efa2d85b222bd256
|
data/bin/arb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: gnuconsulting
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3v3w2f/day_2_solutions/cxk4xpj
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3v3w2f/day_2_solutions/cxk4xpj
|
4
4
|
:body: |-
|
5
5
|
Not-a-programmer solutions in ruby
|
6
6
|
|
@@ -48,15 +48,15 @@
|
|
48
48
|
```
|
49
49
|
:replies:
|
50
50
|
- :author: Aneurysm9
|
51
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3v3w2f/day_2_solutions/cxk5rbh
|
51
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3v3w2f/day_2_solutions/cxk5rbh
|
52
52
|
:body: I'm so proud of you! For a not-a-programmer you came up with pretty much the mirror of my Perl solution.
|
53
53
|
:replies:
|
54
54
|
- :author: gnuconsulting
|
55
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3v3w2f/day_2_solutions/cxki7t4
|
55
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3v3w2f/day_2_solutions/cxki7t4
|
56
56
|
:body: Heh. Pure coincidence I'm sure :-P
|
57
57
|
:replies: []
|
58
58
|
- :author: mikealxmitchell
|
59
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3v3w2f/day_2_solutions/cxk8soe
|
59
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3v3w2f/day_2_solutions/cxk8soe
|
60
60
|
:body: |-
|
61
61
|
Ruby: Day 2 Part I
|
62
62
|
|
@@ -81,7 +81,7 @@
|
|
81
81
|
```
|
82
82
|
:replies: []
|
83
83
|
- :author: adherry
|
84
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3v3w2f/day_2_solutions/cxkqhxw
|
84
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3v3w2f/day_2_solutions/cxkqhxw
|
85
85
|
:body: |-
|
86
86
|
My Ruby solution, could be a bit more dry, but does the job
|
87
87
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: wdomburg
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3v8roh/day_3_solutions/cxm6m18
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3v8roh/day_3_solutions/cxm6m18
|
4
4
|
:body: |-
|
5
5
|
My Ruby solution.
|
6
6
|
|
@@ -53,11 +53,11 @@
|
|
53
53
|
```
|
54
54
|
:replies:
|
55
55
|
- :author: Monofu
|
56
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3v8roh/day_3_solutions/cxnyqsk
|
56
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3v8roh/day_3_solutions/cxnyqsk
|
57
57
|
:body: Using a cycle was genius! I would never thought to use that. Makes so much sense in hindsight...
|
58
58
|
:replies: []
|
59
59
|
- :author: gnuconsulting
|
60
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3v8roh/day_3_solutions/cxldtie
|
60
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3v8roh/day_3_solutions/cxldtie
|
61
61
|
:body: |-
|
62
62
|
Continuing my non-programmer attempts, I kinda like my part 1 solution (mostly because at first I thought this would be super hard and then I remembered hashes) but the part 2 solution is very hacky. I don't like it at all.
|
63
63
|
|
@@ -142,7 +142,7 @@
|
|
142
142
|
```
|
143
143
|
:replies:
|
144
144
|
- :author: dalfgan
|
145
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3v8roh/day_3_solutions/cxmhuu6
|
145
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3v8roh/day_3_solutions/cxmhuu6
|
146
146
|
:body: |-
|
147
147
|
About the first part:
|
148
148
|
|
@@ -158,7 +158,7 @@
|
|
158
158
|
At least, 2nd part you put ",".
|
159
159
|
:replies: []
|
160
160
|
- :author: eregontp
|
161
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3v8roh/day_3_solutions/cxlh10r
|
161
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3v8roh/day_3_solutions/cxlh10r
|
162
162
|
:body: |-
|
163
163
|
Cleaned-up Ruby solution using coroutines (Fiber): The first argument chooses the number of santas (or the puzzle number!)
|
164
164
|
|
@@ -191,7 +191,7 @@
|
|
191
191
|
```
|
192
192
|
:replies: []
|
193
193
|
- :author: haitei
|
194
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3v8roh/day_3_solutions/cxlmjj9
|
194
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3v8roh/day_3_solutions/cxlmjj9
|
195
195
|
:body: |-
|
196
196
|
Relearning Haskell for the nth time:
|
197
197
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: gnuconsulting
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vdn8a/day_4_solutions/cxmmh2t
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vdn8a/day_4_solutions/cxmmh2t
|
4
4
|
:body: |-
|
5
5
|
Day 4 of the non-programmer's solution.
|
6
6
|
|
@@ -20,19 +20,19 @@
|
|
20
20
|
```
|
21
21
|
:replies:
|
22
22
|
- :author: Aneurysm9
|
23
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vdn8a/day_4_solutions/cxmml28
|
23
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vdn8a/day_4_solutions/cxmml28
|
24
24
|
:body: You keep calling yourself a non-programmer and your solutions keep looking a lot like mine. I don't know whether that says something about you or about me!
|
25
25
|
:replies: []
|
26
26
|
- :author: Geambanu
|
27
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vdn8a/day_4_solutions/cxnceun
|
27
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vdn8a/day_4_solutions/cxnceun
|
28
28
|
:body: what language is this?
|
29
29
|
:replies:
|
30
30
|
- :author: joeyrobert
|
31
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vdn8a/day_4_solutions/cxndra5
|
31
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vdn8a/day_4_solutions/cxndra5
|
32
32
|
:body: Ruby.
|
33
33
|
:replies: []
|
34
34
|
- :author: "[deleted]"
|
35
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vdn8a/day_4_solutions/cxpy3d0
|
35
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vdn8a/day_4_solutions/cxpy3d0
|
36
36
|
:body: |-
|
37
37
|
Nice! I wasn't aware of the =~ operator. These challenges are showing me I have A LOT I still need to learn about Ruby!
|
38
38
|
|
@@ -43,11 +43,11 @@
|
|
43
43
|
```
|
44
44
|
:replies: []
|
45
45
|
- :author: karatedog
|
46
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vdn8a/day_4_solutions/cyik9rc
|
46
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vdn8a/day_4_solutions/cyik9rc
|
47
47
|
:body: The 4th day task asks for **at least 5 leading zeros** , not 6.
|
48
48
|
:replies: []
|
49
49
|
- :author: baritoneCoder
|
50
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vdn8a/day_4_solutions/cxn5awm
|
50
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vdn8a/day_4_solutions/cxn5awm
|
51
51
|
:body: |-
|
52
52
|
Simple Ruby solution. Definitely not fast but gets the job done.
|
53
53
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: wdomburg
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3viazx/day_5_solutions/cxnsyn2
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3viazx/day_5_solutions/cxnsyn2
|
4
4
|
:body: |-
|
5
5
|
My Ruby solution. Took me longer than I'd like because I messed up my backreferences at first.
|
6
6
|
|
@@ -25,7 +25,7 @@
|
|
25
25
|
```
|
26
26
|
:replies: []
|
27
27
|
- :author: gnuconsulting
|
28
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3viazx/day_5_solutions/cxnthrm
|
28
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3viazx/day_5_solutions/cxnthrm
|
29
29
|
:body: |-
|
30
30
|
My saddest code yet! Specifically, part one is the first code that I'm actually embarrassed to post. But I figure that as long as I keep getting the right answer... :-P
|
31
31
|
|
@@ -70,11 +70,11 @@
|
|
70
70
|
```
|
71
71
|
:replies:
|
72
72
|
- :author: Aneurysm9
|
73
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3viazx/day_5_solutions/cxnx5x0
|
73
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3viazx/day_5_solutions/cxnx5x0
|
74
74
|
:body: The only thing sad about part 1 is not using ([a-z])\1. I thought I knew how to use backreferences but kept on misusing them and screwing up the groupings, which certainly cost me a few spots on the board.
|
75
75
|
:replies: []
|
76
76
|
- :author: miftrim
|
77
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3viazx/day_5_solutions/cxnuxod
|
77
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3viazx/day_5_solutions/cxnuxod
|
78
78
|
:body: |-
|
79
79
|
Ruby!
|
80
80
|
|
@@ -111,7 +111,7 @@
|
|
111
111
|
☆_:.。.o(≧▽≦)o.。.:_☆
|
112
112
|
:replies: []
|
113
113
|
- :author: zacwaz
|
114
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3viazx/day_5_solutions/cxo8upq
|
114
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3viazx/day_5_solutions/cxo8upq
|
115
115
|
:body: |-
|
116
116
|
Here's another **Ruby** solution. Instead of clever one-liners, for these challenges I've been trying to focus on writing [obvious, readable code using small methods and classes](https://robots.thoughtbot.com/sandi-metz-rules-for-developers). I'd appreciate any critiques or suggestions!
|
117
117
|
|
@@ -195,7 +195,7 @@
|
|
195
195
|
```
|
196
196
|
:replies: []
|
197
197
|
- :author: Aeverous
|
198
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3viazx/day_5_solutions/cy0s1pr
|
198
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3viazx/day_5_solutions/cy0s1pr
|
199
199
|
:body: |-
|
200
200
|
My newbie **Ruby** solution, had to play around with http://regexr.com/ for awhile, but it works!
|
201
201
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: bluishness
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxp12nt
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxp12nt
|
4
4
|
:body: |-
|
5
5
|
Anyone up for golf? This is my attempt in Ruby, 268 characters.
|
6
6
|
|
@@ -16,18 +16,18 @@
|
|
16
16
|
```
|
17
17
|
:replies:
|
18
18
|
- :author: de_Selby
|
19
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxpch3e
|
19
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxpch3e
|
20
20
|
:body: "/u/geocar has you beaten easily using K [in this comment](https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxoziw1)"
|
21
21
|
:replies:
|
22
22
|
- :author: bluishness
|
23
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxpjfzr
|
23
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxpjfzr
|
24
24
|
:body: |-
|
25
25
|
Oh wow, that is rather terse, and I don't even have a clue what's going on there. Always great to see how much there is yet to learn.
|
26
26
|
|
27
27
|
I'm always aiming for something that'll fit into a tweet, but that might be impossible with all the logic in this one.
|
28
28
|
:replies:
|
29
29
|
- :author: geocar
|
30
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxq3g45
|
30
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxq3g45
|
31
31
|
:body: |-
|
32
32
|
This isn't golf: There are a few easy ways to make it smaller, but this is the first thing that came out of my head, so _I_ could not have coded something else faster in another language.
|
33
33
|
|
@@ -100,11 +100,11 @@
|
|
100
100
|
If this is something you want to try, [download](http://kx.com/software-download.php) the free version of KDB. You can press [backslash](http://code.kx.com/wiki/Reference/BackSlash#toggle_q.2Fk) to switch from q (the default very wordy language) and k (much more terse and easier to write).
|
101
101
|
:replies: []
|
102
102
|
- :author: "[deleted]"
|
103
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxpoveo
|
103
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxpoveo
|
104
104
|
:body: '"Beaten" sizewise, maybe.'
|
105
105
|
:replies: []
|
106
106
|
- :author: fnoco_xandy
|
107
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxov2ms
|
107
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxov2ms
|
108
108
|
:body: |-
|
109
109
|
ugly crystal (and i guess ruby) solution for part 2. part1 is just some changes in the case when statement. a lot could be improved but thats the code that got me to place 67
|
110
110
|
|
@@ -143,7 +143,7 @@
|
|
143
143
|
```
|
144
144
|
:replies: []
|
145
145
|
- :author: wdomburg
|
146
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxovasv
|
146
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxovasv
|
147
147
|
:body: |-
|
148
148
|
Not my night. Interruptions, fatigue and a few stupid mistakes (like setting the point to 1 for OFF, or not clearing the grid after correcting that mistake) conspired to make this take way too long.
|
149
149
|
|
@@ -215,7 +215,7 @@
|
|
215
215
|
```
|
216
216
|
:replies:
|
217
217
|
- :author: wdomburg
|
218
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxowpgt
|
218
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxowpgt
|
219
219
|
:body: |-
|
220
220
|
Since a few people were posting benchmarks on their Ruby code:
|
221
221
|
|
@@ -224,7 +224,7 @@
|
|
224
224
|
(For both answers).
|
225
225
|
:replies: []
|
226
226
|
- :author: miftrim
|
227
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxovm2p
|
227
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxovm2p
|
228
228
|
:body: |-
|
229
229
|
My Ruby solution. This takes like a solid three minutes to run. There must be faster ways to do it.
|
230
230
|
|
@@ -342,7 +342,7 @@
|
|
342
342
|
```
|
343
343
|
:replies: []
|
344
344
|
- :author: jjshanks
|
345
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxow7d6
|
345
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxow7d6
|
346
346
|
:body: |-
|
347
347
|
Ruby solution using dictionary of keys approach. String keys "#{x},#{y}" took ~40 seconds, int keys x \* 1000 + y took ~15 seconds. This is part 1 but part 2 is basically the same except I use a hash table instead of a set.
|
348
348
|
|
@@ -387,7 +387,7 @@
|
|
387
387
|
```
|
388
388
|
:replies: []
|
389
389
|
- :author: jchook
|
390
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxox2z0
|
390
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxox2z0
|
391
391
|
:body: |-
|
392
392
|
Ruby, object-oriented solution
|
393
393
|
|
@@ -455,7 +455,7 @@
|
|
455
455
|
```
|
456
456
|
:replies: []
|
457
457
|
- :author: ericdykstra
|
458
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxp3btf
|
458
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxp3btf
|
459
459
|
:body: |-
|
460
460
|
Here's my Ruby solution for part 2. I looked through the other ones posted here and thought mine was different enough to merit posting. It's pretty minimalist and easy to read. Enjoy!
|
461
461
|
|
@@ -479,7 +479,7 @@
|
|
479
479
|
```
|
480
480
|
:replies: []
|
481
481
|
- :author: gnuconsulting
|
482
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxpvbp2
|
482
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxpvbp2
|
483
483
|
:body: |-
|
484
484
|
Phew! By far the hardest day yet, this non-programmer took about an hour with lots of print-variable debugging and head scratching.
|
485
485
|
|
@@ -631,7 +631,7 @@
|
|
631
631
|
I'm scared for tomorrow's puzzle...
|
632
632
|
:replies: []
|
633
633
|
- :author: AnchorText
|
634
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxqg7s8
|
634
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vmltn/day_6_solutions/cxqg7s8
|
635
635
|
:body: |-
|
636
636
|
Straightforward Ruby solution with just 3 methods and 3 Procs! Please note that in my `directions.txt` I've changed "turn on" and "turn off" to "turnon" and "turnoff" respectively for easier splitting.
|
637
637
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: '0x0dea'
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxq07ki
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxq07ki
|
4
4
|
:body: |-
|
5
5
|
Sorting the outputs by length and then lexicographically makes this dead-simple. First place on the leaderboard could've gone to the first out-of-the-box thinker by a wide margin. :\<
|
6
6
|
|
@@ -27,33 +27,33 @@
|
|
27
27
|
```
|
28
28
|
:replies:
|
29
29
|
- :author: _jonah
|
30
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxq22qk
|
30
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxq22qk
|
31
31
|
:body: Very nice. Just learned a couple new tricks from this. Thanks.
|
32
32
|
:replies:
|
33
33
|
- :author: '0x0dea'
|
34
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxq24wh
|
34
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxq24wh
|
35
35
|
:body: My pleasure. I count seven things that might be considered "tricks" by an intermediate Ruby programmer. For the sake of my curiosity, would you mind sharing?
|
36
36
|
:replies:
|
37
37
|
- :author: _jonah
|
38
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxq2bpe
|
38
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxq2bpe
|
39
39
|
:body: |-
|
40
40
|
1. Using a hash as 2nd arg to gsub
|
41
41
|
2. Regexp.union method -- not really a trick but something I never think of
|
42
42
|
3. ?; for golfed single char string
|
43
43
|
:replies: []
|
44
44
|
- :author: 5ef23132-c4a0-49a0-8
|
45
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxq2lsw
|
45
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxq2lsw
|
46
46
|
:body: |-
|
47
47
|
nice solution, I didn't event think about the replace/eval trick.
|
48
48
|
|
49
49
|
This solution doesn't work for all inputs right, wouldn't `c -> b` throw a `NameError`?
|
50
50
|
:replies: []
|
51
51
|
- :author: "[deleted]"
|
52
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxr1w6y
|
52
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxr1w6y
|
53
53
|
:body: "[deleted]"
|
54
54
|
:replies: []
|
55
55
|
- :author: gnuconsulting
|
56
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxq2b7s
|
56
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxq2b7s
|
57
57
|
:body: |-
|
58
58
|
I'm quickly reaching the limits of my competence. If this is the initial downslope of the rollercoaster (to borrow topaz's analogy), I'm gonna get thrown off at the first curve...
|
59
59
|
|
@@ -107,19 +107,19 @@
|
|
107
107
|
For part 2 I cheated and modified my input.txt to set 'b' to the value I got for 'a'. _grin_
|
108
108
|
:replies:
|
109
109
|
- :author: metric152
|
110
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxv2kz7
|
110
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxv2kz7
|
111
111
|
:body: I kind of thought recursion would have made it much better<shakes head></shakes>
|
112
112
|
:replies:
|
113
113
|
- :author: gnuconsulting
|
114
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxv3n1e
|
114
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxv3n1e
|
115
115
|
:body: I guess it depends what you mean by 'better'. ¯\_(ツ)\_/¯
|
116
116
|
:replies:
|
117
117
|
- :author: metric152
|
118
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxwnu3w
|
118
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxwnu3w
|
119
119
|
:body: Your solution is much shorter than mine because it uses recursion. I wish I would have done the same with mine. It's around 170 lines.
|
120
120
|
:replies: []
|
121
121
|
- :author: fnoco_xandy
|
122
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxq0ec6
|
122
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxq0ec6
|
123
123
|
:body: |-
|
124
124
|
ugly crystal/ruby solution. it remembers outputs by changing the circuit. that's why i create a second circuit to calculate b. without the changes calculating a takes too long(i initially thought i had a loop)
|
125
125
|
|
@@ -216,7 +216,7 @@
|
|
216
216
|
```
|
217
217
|
:replies: []
|
218
218
|
- :author: epitron
|
219
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxq0fjh
|
219
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxq0fjh
|
220
220
|
:body: |-
|
221
221
|
Here's a nice short Ruby version that uses `instance_eval` to generate a method for each wire:
|
222
222
|
|
@@ -254,7 +254,7 @@
|
|
254
254
|
(Why reimplement a crappy verison of `eval` when you can use the real thing? :)
|
255
255
|
:replies: []
|
256
256
|
- :author: _jonah
|
257
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxq1soj
|
257
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxq1soj
|
258
258
|
:body: |-
|
259
259
|
Ruby:
|
260
260
|
|
@@ -280,14 +280,14 @@
|
|
280
280
|
```
|
281
281
|
:replies: []
|
282
282
|
- :author: dubokk15
|
283
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxskam0
|
283
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxskam0
|
284
284
|
:body: |-
|
285
285
|
Ruby. [Github](https://github.com/klieth/day7)
|
286
286
|
|
287
287
|
I may have gone insanely overboard, but I built a full parser/tokenizer/AST and an emulator run it all.
|
288
288
|
:replies: []
|
289
289
|
- :author: wdomburg
|
290
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxuw4go
|
290
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vr4m4/day_7_solutions/cxuw4go
|
291
291
|
:body: |-
|
292
292
|
Not that anyone will see this, but now that I'm getting back to things, might as well post it:
|
293
293
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: SnacksOnAPlane
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vw32y/day_8_solutions/cxr8gpg
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vw32y/day_8_solutions/cxr8gpg
|
4
4
|
:body: |-
|
5
5
|
**Ruby**
|
6
6
|
|
@@ -35,19 +35,19 @@
|
|
35
35
|
```
|
36
36
|
:replies:
|
37
37
|
- :author: gfixler
|
38
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vw32y/day_8_solutions/cxr9142
|
38
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vw32y/day_8_solutions/cxr9142
|
39
39
|
:body: Do you still get the right answers without the chomps?
|
40
40
|
:replies:
|
41
41
|
- :author: "[deleted]"
|
42
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vw32y/day_8_solutions/cxr95zi
|
42
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vw32y/day_8_solutions/cxr95zi
|
43
43
|
:body: "[deleted]"
|
44
44
|
:replies:
|
45
45
|
- :author: gfixler
|
46
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vw32y/day_8_solutions/cxr9gsc
|
46
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vw32y/day_8_solutions/cxr9gsc
|
47
47
|
:body: If you leave them in, the delta stays the same between input and output.
|
48
48
|
:replies: []
|
49
49
|
- :author: packrat386
|
50
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vw32y/day_8_solutions/cxr8pmv
|
50
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vw32y/day_8_solutions/cxr8pmv
|
51
51
|
:body: |-
|
52
52
|
Roughly 12 lines of ruby, eval is fun
|
53
53
|
|
@@ -71,7 +71,7 @@
|
|
71
71
|
```
|
72
72
|
:replies: []
|
73
73
|
- :author: gnuconsulting
|
74
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3vw32y/day_8_solutions/cxr8y8u
|
74
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3vw32y/day_8_solutions/cxr8y8u
|
75
75
|
:body: |-
|
76
76
|
Wasted a bunch of time trying to do it just doing global search/replace regexes in vim, couldn't get the magic incantation right. Peeked over here, saw a python solution using eval which made a lightbulb go off and it was pretty easy from there. As per the moderator's comment, I only scrolled down to look at the answers when the leaderboard was already full. _grin_
|
77
77
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: gareve
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxtgagf
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxtgagf
|
4
4
|
:body: |-
|
5
5
|
Ruby solution for both parts of the problem :)
|
6
6
|
|
@@ -16,18 +16,18 @@
|
|
16
16
|
```
|
17
17
|
:replies:
|
18
18
|
- :author: a_dollar_sign_texas
|
19
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxtqbtb
|
19
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxtqbtb
|
20
20
|
:body: |-
|
21
21
|
I am in absolute awe of this. And I'm even familiar with the whole notation matters story of knuth vs. shell script: http://www.leancrew.com/all-this/2011/12/more-shell-less-egg/.
|
22
22
|
|
23
23
|
Wow. Just ... that is brilliant. May I ask why you approached the problem in such a way? I thought that TSP was going to have significant code, even for just a brute force solution.
|
24
24
|
:replies:
|
25
25
|
- :author: gareve
|
26
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxtz4l1
|
26
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxtz4l1
|
27
27
|
:body: Thanks, let's thank Ruby :) I started with the traditional solution and cleaned up the parts that I was uncomfortable with. The last improvement was the [x, y].sort
|
28
28
|
:replies: []
|
29
29
|
- :author: _jonah
|
30
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxskk63
|
30
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxskk63
|
31
31
|
:body: |-
|
32
32
|
Ruby:
|
33
33
|
|
@@ -48,7 +48,7 @@
|
|
48
48
|
```
|
49
49
|
:replies: []
|
50
50
|
- :author: SnacksOnAPlane
|
51
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxsivkf
|
51
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxsivkf
|
52
52
|
:body: |-
|
53
53
|
**Ruby**
|
54
54
|
|
@@ -93,7 +93,7 @@
|
|
93
93
|
```
|
94
94
|
:replies:
|
95
95
|
- :author: dubokk15
|
96
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxsmv3h
|
96
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxsmv3h
|
97
97
|
:body: |-
|
98
98
|
Here's the same solution with lots of Ruby shortcuts:
|
99
99
|
|
@@ -120,7 +120,7 @@
|
|
120
120
|
```
|
121
121
|
:replies: []
|
122
122
|
- :author: ericdykstra
|
123
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxsixwb
|
123
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxsixwb
|
124
124
|
:body: |-
|
125
125
|
Leveraging Ruby's permutation method...
|
126
126
|
|
@@ -147,7 +147,7 @@
|
|
147
147
|
```
|
148
148
|
:replies: []
|
149
149
|
- :author: fnoco_xandy
|
150
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxsj2td
|
150
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxsj2td
|
151
151
|
:body: |-
|
152
152
|
brute force crystal/ruby solution, $find\_shortest with true for part 1, false for part 2.
|
153
153
|
|
@@ -188,7 +188,7 @@
|
|
188
188
|
```
|
189
189
|
:replies: []
|
190
190
|
- :author: tremendo
|
191
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxskeec
|
191
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxskeec
|
192
192
|
:body: |-
|
193
193
|
Another Ruby, brute force (permutation) solution. My delay was I was trying to close the loop, assuming Santa had to return to the starting point
|
194
194
|
|
@@ -226,7 +226,7 @@
|
|
226
226
|
```
|
227
227
|
:replies: []
|
228
228
|
- :author: HorizonShadow
|
229
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxt5zzn
|
229
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxt5zzn
|
230
230
|
:body: |-
|
231
231
|
Ruby (All of my solutions [here](https://github.com/HorizonShadow/Advent-of-Code)):
|
232
232
|
|
@@ -292,7 +292,7 @@
|
|
292
292
|
```
|
293
293
|
:replies: []
|
294
294
|
- :author: mushy_plushy
|
295
|
-
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxtahil
|
295
|
+
:url: https://www.reddit.com/r/adventofcode/comments/3w192e/day_9_solutions/cxtahil
|
296
296
|
:body: |-
|
297
297
|
Ruby brute force. Yields lowest value. For highest value 'min' is replaced by 'max' at end.
|
298
298
|
|