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
@@ -1,13 +1,13 @@
|
|
1
1
|
---
|
2
2
|
- :author: J-Swift
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e8m1z3/2019_day_10_solutions/fbcvg9u
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e8m1z3/2019_day_10_solutions/fbcvg9u
|
4
4
|
:body: |-
|
5
5
|
Ruby
|
6
6
|
|
7
7
|
https://github.com/J-Swift/advent-of-code-2019/tree/master/day\_10
|
8
8
|
:replies: []
|
9
9
|
- :author: Yardboy
|
10
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e8m1z3/2019_day_10_solutions/fai82fg
|
10
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e8m1z3/2019_day_10_solutions/fai82fg
|
11
11
|
:body: |-
|
12
12
|
# Ruby
|
13
13
|
|
@@ -36,7 +36,7 @@
|
|
36
36
|
After I solved it using only the slope
|
37
37
|
:replies: []
|
38
38
|
- :author: el_daniero
|
39
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e8m1z3/2019_day_10_solutions/fafbqhm
|
39
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e8m1z3/2019_day_10_solutions/fafbqhm
|
40
40
|
:body: |-
|
41
41
|
Ruby.
|
42
42
|
|
@@ -83,7 +83,7 @@
|
|
83
83
|
```
|
84
84
|
:replies: []
|
85
85
|
- :author: petercooper
|
86
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e8m1z3/2019_day_10_solutions/fae1va2
|
86
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e8m1z3/2019_day_10_solutions/fae1va2
|
87
87
|
:body: |-
|
88
88
|
**Ruby**
|
89
89
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
---
|
2
2
|
- :author: J-Swift
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e92jm2/2019_day_11_solutions/fbczcr4
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e92jm2/2019_day_11_solutions/fbczcr4
|
4
4
|
:body: |-
|
5
5
|
Ruby
|
6
6
|
|
7
7
|
https://github.com/J-Swift/advent-of-code-2019/tree/master/day\_11
|
8
8
|
:replies: []
|
9
9
|
- :author: Kache
|
10
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e92jm2/2019_day_11_solutions/faj25ci
|
10
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e92jm2/2019_day_11_solutions/faj25ci
|
11
11
|
:body: |-
|
12
12
|
**Ruby** shortened to 17 lines, not counting `Intcode`:
|
13
13
|
|
@@ -32,7 +32,7 @@
|
|
32
32
|
```
|
33
33
|
:replies: []
|
34
34
|
- :author: el_daniero
|
35
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e92jm2/2019_day_11_solutions/fai7sld
|
35
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e92jm2/2019_day_11_solutions/fai7sld
|
36
36
|
:body: |-
|
37
37
|
Ruby again.
|
38
38
|
|
@@ -66,7 +66,7 @@
|
|
66
66
|
The whole thing can be seen here: [aoc2019/ruby/11.rb](https://github.com/daniero/code-challenges/blob/master/aoc2019/ruby/11.rb)
|
67
67
|
:replies: []
|
68
68
|
- :author: Yardboy
|
69
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e92jm2/2019_day_11_solutions/fai7p2m
|
69
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e92jm2/2019_day_11_solutions/fai7p2m
|
70
70
|
:body: |-
|
71
71
|
# Ruby
|
72
72
|
|
@@ -93,7 +93,7 @@
|
|
93
93
|
Cause then I had the answer right
|
94
94
|
:replies: []
|
95
95
|
- :author: MaterialFerret
|
96
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e92jm2/2019_day_11_solutions/fai5kx5
|
96
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e92jm2/2019_day_11_solutions/fai5kx5
|
97
97
|
:body: |-
|
98
98
|
# Ruby
|
99
99
|
|
@@ -102,7 +102,7 @@
|
|
102
102
|
[https://github.com/LesnyRumcajs/advent-of-ruby-2019/blob/master/src/day11.rb](https://github.com/LesnyRumcajs/advent-of-ruby-2019/blob/master/src/day11.rb)
|
103
103
|
:replies: []
|
104
104
|
- :author: hdf1986
|
105
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e92jm2/2019_day_11_solutions/fahd4f9
|
105
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e92jm2/2019_day_11_solutions/fahd4f9
|
106
106
|
:body: |-
|
107
107
|
I did wrote my solutions on Ruby, if there's another intcode problem i'll probably separate my intcodeVM to another module/file.
|
108
108
|
|
@@ -113,7 +113,7 @@
|
|
113
113
|
Part2: [https://github.com/hdf1986/advent-of-code/blob/master/day11/part2.rb](https://github.com/hdf1986/advent-of-code/blob/master/day11/part1.rb)
|
114
114
|
:replies: []
|
115
115
|
- :author: p_tseng
|
116
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e92jm2/2019_day_11_solutions/fagct5o
|
116
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e92jm2/2019_day_11_solutions/fagct5o
|
117
117
|
:body: |-
|
118
118
|
Ruby [11_intcode_langtons\_ant.rb](https://github.com/petertseng/adventofcode-rb-2019/blob/master/11_intcode_langtons_ant.rb) and [lib/intcode.rb](https://github.com/petertseng/adventofcode-rb-2019/blob/master/lib/intcode.rb) for 96/56 today. Has been cleaned up but the idea is the same.
|
119
119
|
|
@@ -1,20 +1,20 @@
|
|
1
1
|
---
|
2
2
|
- :author: J-Swift
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fbd2dmf
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fbd2dmf
|
4
4
|
:body: |-
|
5
5
|
Ruby
|
6
6
|
|
7
7
|
https://github.com/J-Swift/advent-of-code-2019/tree/master/day\_12
|
8
8
|
:replies:
|
9
9
|
- :author: craigontour
|
10
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fefyp14
|
10
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fefyp14
|
11
11
|
:body: |-
|
12
12
|
> Swift
|
13
13
|
|
14
14
|
Hi. Please could you explain the logic of your hashing. I see it creates a hash for each axis. How does this get to an answer?
|
15
15
|
:replies:
|
16
16
|
- :author: J-Swift
|
17
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/feirq84
|
17
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/feirq84
|
18
18
|
:body: |-
|
19
19
|
The general solution relies on the fact that X/Y/Z are actually independent. So you figure out how long X takes to repeat by itself, how long Y takes to repeat by itself, and how long Z takes to repeat by itself. Then you figure out the least common multiple of those for the solution.
|
20
20
|
|
@@ -44,14 +44,14 @@
|
|
44
44
|
I chose the '\_' and 'x' characters so that the components being joined were unambiguous.
|
45
45
|
:replies: []
|
46
46
|
- :author: MaterialFerret
|
47
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fauykys
|
47
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fauykys
|
48
48
|
:body: |-
|
49
49
|
Ruby: [https://github.com/LesnyRumcajs/advent-of-ruby-2019/blob/master/src/day12.rb](https://github.com/LesnyRumcajs/advent-of-ruby-2019/blob/master/src/day12.rb)
|
50
50
|
|
51
51
|
I believe I came up with relatively clean and short solution - nothing innovative though, looking at the thread. LCMing the x,y and z for part 2. The day I started Advent of Code 2019 in Ruby I abandoned all hope of brute-forcing the solutions. :)
|
52
52
|
:replies: []
|
53
53
|
- :author: Yardboy
|
54
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fam8via
|
54
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fam8via
|
55
55
|
:body: |-
|
56
56
|
# Ruby
|
57
57
|
|
@@ -64,14 +64,14 @@
|
|
64
64
|
[https://github.com/Yardboy/advent-of-code/blob/master/2019/puzzle12b/solution.rb](https://github.com/Yardboy/advent-of-code/blob/master/2019/puzzle12b/solution.rb)
|
65
65
|
:replies: []
|
66
66
|
- :author: petercooper
|
67
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/faknhog
|
67
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/faknhog
|
68
68
|
:body: |-
|
69
69
|
**Ruby**
|
70
70
|
|
71
71
|
Because there are so few Ruby solutions here. For the first time this AOC, I caved in and actually used classes and a little structure rather than golfing it as tiny as possible. It still ended up reasonably tight, however: https://github.com/peterc/aoc2019solutions/blob/master/12.rb
|
72
72
|
:replies: []
|
73
73
|
- :author: hdf1986
|
74
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fakngcd
|
74
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fakngcd
|
75
75
|
:body: |-
|
76
76
|
**Ruby**
|
77
77
|
|
@@ -82,7 +82,7 @@
|
|
82
82
|
Part 2: [https://github.com/hdf1986/advent-of-code/blob/master/day12/part2.rb](https://github.com/hdf1986/advent-of-code/blob/master/day12/part2.rb)
|
83
83
|
:replies: []
|
84
84
|
- :author: tckmn
|
85
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/faja2gk
|
85
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/faja2gk
|
86
86
|
:body: |-
|
87
87
|
ruby 28/14
|
88
88
|
|
@@ -109,37 +109,37 @@
|
|
109
109
|
the strategy, which i assume was the intended one, was to find the period for each coordinate and then lcm them together
|
110
110
|
:replies:
|
111
111
|
- :author: sophiebits
|
112
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fajbk9u
|
112
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fajbk9u
|
113
113
|
:body: Um. Tell us more about how you landed on using this hash function.
|
114
114
|
:replies:
|
115
115
|
- :author: tckmn
|
116
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fajc1o1
|
116
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fajc1o1
|
117
117
|
:body: that is where my fingers landed on my keyboard
|
118
118
|
:replies:
|
119
119
|
- :author: sophiebits
|
120
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fajd1bh
|
120
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fajd1bh
|
121
121
|
:body: Not worried about collisions?
|
122
122
|
:replies:
|
123
123
|
- :author: tckmn
|
124
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fal3bkl
|
124
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fal3bkl
|
125
125
|
:body: the original code had fewer digits at the end, i tacked on a few and compared the answers to make sure that didn't happen :P
|
126
126
|
:replies: []
|
127
127
|
- :author: Kache
|
128
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fajfkbc
|
128
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fajfkbc
|
129
129
|
:body: |-
|
130
130
|
What's the `#ris` method?
|
131
131
|
|
132
132
|
Every ruby object has a `#hash` method, by the way, (although I learned from [another comment](https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/faja0lj?utm_source=share&utm_medium=web2x) that it wasn't necessary).
|
133
133
|
:replies:
|
134
134
|
- :author: tckmn
|
135
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fal361d
|
135
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fal361d
|
136
136
|
:body: |-
|
137
137
|
oh, that's "[r]egex [i]nt[s]", which is a short helper function in my template file that's basically `self.scan(/-?\d+/).map(&:to_i)`
|
138
138
|
|
139
139
|
also, that's good to know, thanks!
|
140
140
|
:replies: []
|
141
141
|
- :author: petercooper
|
142
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/faknabz
|
142
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/faknabz
|
143
143
|
:body: |-
|
144
144
|
While this is paraphrasing somewhat, my solution replaces the `asdfasdf` line with something like:
|
145
145
|
|
@@ -148,10 +148,10 @@
|
|
148
148
|
.. which nets you something both small and unique to the data, although your solution is different enough that I might be missing something obvious :)
|
149
149
|
:replies:
|
150
150
|
- :author: tckmn
|
151
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fal2y3e
|
151
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fal2y3e
|
152
152
|
:body: ah nice - you are definitely not missing anything obvious, this was just the first thing that came to mind when trying to go fast :P
|
153
153
|
:replies:
|
154
154
|
- :author: petercooper
|
155
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fal7ub5
|
155
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9j0ve/2019_day_12_solutions/fal7ub5
|
156
156
|
:body: To be honest, the pack thing was part of my refactor. My initial "off the cuff" looked more like yours, but was like `a[0] << 48 + a[1] << 32 + a[2] << 16 + a[3]` or something like that, but I've spent a lot of time living in C(!) :-)
|
157
157
|
:replies: []
|
@@ -1,13 +1,13 @@
|
|
1
1
|
---
|
2
2
|
- :author: J-Swift
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9zgse/2019_day_13_solutions/fbdyaia
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9zgse/2019_day_13_solutions/fbdyaia
|
4
4
|
:body: |-
|
5
5
|
Ruby
|
6
6
|
|
7
7
|
https://github.com/J-Swift/advent-of-code-2019/tree/master/day\_13
|
8
8
|
:replies: []
|
9
9
|
- :author: Yardboy
|
10
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9zgse/2019_day_13_solutions/fb5loqa
|
10
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9zgse/2019_day_13_solutions/fb5loqa
|
11
11
|
:body: |-
|
12
12
|
# Ruby
|
13
13
|
|
@@ -16,7 +16,7 @@
|
|
16
16
|
[https://github.com/Yardboy/advent-of-code/blob/master/2019/puzzle13b/solution.rb](https://github.com/Yardboy/advent-of-code/blob/master/2019/puzzle13b/solution.rb)
|
17
17
|
:replies: []
|
18
18
|
- :author: hdf1986
|
19
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9zgse/2019_day_13_solutions/fapgw34
|
19
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9zgse/2019_day_13_solutions/fapgw34
|
20
20
|
:body: |-
|
21
21
|
**Ruby**
|
22
22
|
|
@@ -36,21 +36,21 @@
|
|
36
36
|
[https://github.com/hdf1986/advent-of-code/tree/master/day13](https://github.com/hdf1986/advent-of-code/tree/master/day13)
|
37
37
|
:replies: []
|
38
38
|
- :author: vinc686
|
39
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9zgse/2019_day_13_solutions/fan7f6r
|
39
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9zgse/2019_day_13_solutions/fan7f6r
|
40
40
|
:body: |-
|
41
41
|
[Ruby](https://github.com/vinc/adventofcode/blob/master/ruby/2019/13/)[Screenshot](https://github.com/vinc/adventofcode/blob/master/ruby/2019/13/screenshot.png)
|
42
42
|
|
43
43
|
My favorite day so far, very fun! I naively tried to win the game by hand for about a minute before giving up. I also had to hack my `Computer#run` method to get the input from a block and I lost some time there because the last screen after winning the game in autoplay was not printed.
|
44
44
|
:replies:
|
45
45
|
- :author: ColonelMcColonel
|
46
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9zgse/2019_day_13_solutions/fan82qb
|
46
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9zgse/2019_day_13_solutions/fan82qb
|
47
47
|
:body: |-
|
48
48
|
Hahaha I did the same too!
|
49
49
|
|
50
50
|
I also watched it auto play, I knew I could run it much faster if I just executed the auto-player without rendering at 60FPS, but hey - it was so satisfying!
|
51
51
|
:replies: []
|
52
52
|
- :author: p_tseng
|
53
|
-
:url: https://www.reddit.com/r/adventofcode/comments/e9zgse/2019_day_13_solutions/fan6cjr
|
53
|
+
:url: https://www.reddit.com/r/adventofcode/comments/e9zgse/2019_day_13_solutions/fan6cjr
|
54
54
|
:body: |-
|
55
55
|
Just for fun... of course I solved the problem the regular way at first, but that takes my poor Ruby code _an entire second_ to run, and that's just too slow.
|
56
56
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: Yardboy
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/eafj32/2019_day_14_solutions/fbbicfv
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/eafj32/2019_day_14_solutions/fbbicfv
|
4
4
|
:body: |-
|
5
5
|
# Ruby
|
6
6
|
|
@@ -9,7 +9,7 @@
|
|
9
9
|
[https://github.com/Yardboy/advent-of-code/blob/master/2019/puzzle14b/solution.rb](https://github.com/Yardboy/advent-of-code/blob/master/2019/puzzle14b/solution.rb)
|
10
10
|
:replies: []
|
11
11
|
- :author: vinc686
|
12
|
-
:url: https://www.reddit.com/r/adventofcode/comments/eafj32/2019_day_14_solutions/faurisj
|
12
|
+
:url: https://www.reddit.com/r/adventofcode/comments/eafj32/2019_day_14_solutions/faurisj
|
13
13
|
:body: |-
|
14
14
|
[Ruby](https://github.com/vinc/adventofcode/blob/master/ruby/2019/14/lib.rb)
|
15
15
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
---
|
2
2
|
- :author: J-Swift
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/eaurfo/2019_day_15_solutions/fbtloxq
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/eaurfo/2019_day_15_solutions/fbtloxq
|
4
4
|
:body: |-
|
5
5
|
Ruby
|
6
6
|
|
7
7
|
https://github.com/J-Swift/advent-of-code-2019/tree/master/day\_15
|
8
8
|
:replies: []
|
9
9
|
- :author: petercooper
|
10
|
-
:url: https://www.reddit.com/r/adventofcode/comments/eaurfo/2019_day_15_solutions/fb2lefx
|
10
|
+
:url: https://www.reddit.com/r/adventofcode/comments/eaurfo/2019_day_15_solutions/fb2lefx
|
11
11
|
:body: |-
|
12
12
|
[**Ruby**](https://github.com/peterc/aoc2019solutions/blob/master/15.rb)
|
13
13
|
|
@@ -18,7 +18,7 @@
|
|
18
18
|
_Update: So for part 2 I managed to avoid implementing anything. I just took my maximum distance on the entire map, took away the distance from the origin at the closest intersection to the oxygen tank, then added the length of the passage to to the oxygen tank. No path searching needed as I had the distance values already stored for every single block :-)_
|
19
19
|
:replies: []
|
20
20
|
- :author: BluFoot
|
21
|
-
:url: https://www.reddit.com/r/adventofcode/comments/eaurfo/2019_day_15_solutions/faxs1m7
|
21
|
+
:url: https://www.reddit.com/r/adventofcode/comments/eaurfo/2019_day_15_solutions/faxs1m7
|
22
22
|
:body: |-
|
23
23
|
[Ruby 54/52](https://github.com/acornellier/adventofcode/blob/master/2019/15.rb)
|
24
24
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
---
|
2
2
|
- :author: Kache
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ebai4g/2019_day_16_solutions/fb3zrlr
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ebai4g/2019_day_16_solutions/fb3zrlr
|
4
4
|
:body: |-
|
5
5
|
**Ruby**
|
6
6
|
|
7
7
|
[Part 1 and 2](https://github.com/Kache/advent_of_code/blob/8ee09f0889873dea5d4fde32ebcd160b5a2dd8b7/2019/solutions.rb#L599), about 10 lines each, runs in 2 secs & 4 secs, respectively
|
8
8
|
:replies:
|
9
9
|
- :author: craigontour
|
10
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ebai4g/2019_day_16_solutions/fezx2c3
|
10
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ebai4g/2019_day_16_solutions/fezx2c3
|
11
11
|
:body: |-
|
12
12
|
> Ruby
|
13
13
|
|
@@ -24,7 +24,7 @@
|
|
24
24
|
Regards
|
25
25
|
:replies:
|
26
26
|
- :author: Kache
|
27
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ebai4g/2019_day_16_solutions/ff2c8ir
|
27
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ebai4g/2019_day_16_solutions/ff2c8ir
|
28
28
|
:body: |-
|
29
29
|
Unwrapping the `reduce`, the above is same as:
|
30
30
|
|
@@ -37,11 +37,11 @@
|
|
37
37
|
```
|
38
38
|
:replies:
|
39
39
|
- :author: craigontour
|
40
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ebai4g/2019_day_16_solutions/ff39jff
|
40
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ebai4g/2019_day_16_solutions/ff39jff
|
41
41
|
:body: Sorry, I was really after explanation of how reduce(0) works
|
42
42
|
:replies: []
|
43
43
|
- :author: petercooper
|
44
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ebai4g/2019_day_16_solutions/fb4e57x
|
44
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ebai4g/2019_day_16_solutions/fb4e57x
|
45
45
|
:body: |-
|
46
46
|
Woop, Rubyists unite here in the comments :-)
|
47
47
|
|
@@ -54,6 +54,6 @@
|
|
54
54
|
https://github.com/peterc/aoc2019solutions/blob/master/16.rb
|
55
55
|
:replies:
|
56
56
|
- :author: vinc686
|
57
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ebai4g/2019_day_16_solutions/fb5105r
|
57
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ebai4g/2019_day_16_solutions/fb5105r
|
58
58
|
:body: I couldn't finish part 2 in time today, I'm really impressed by both of you, my code is a mess by comparison!
|
59
59
|
:replies: []
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: p_tseng
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ebr7dg/2019_day_17_solutions/fb73yzz
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ebr7dg/2019_day_17_solutions/fb73yzz
|
4
4
|
:body: |-
|
5
5
|
I guess I'll throw my kinda weird solution out there, in the style of some of the weird solutions to day 13.
|
6
6
|
|
@@ -18,11 +18,11 @@
|
|
18
18
|
I mostly wrote this code since I haven't properly written the code that breaks up the instruction list into three functions yet, so this is just to amuse me while I figure that out and write that...
|
19
19
|
:replies:
|
20
20
|
- :author: gedhrel
|
21
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ebr7dg/2019_day_17_solutions/fb8xxx5
|
21
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ebr7dg/2019_day_17_solutions/fb8xxx5
|
22
22
|
:body: Yup. I've been reverse engineering the intcode each day after solving the puzzle. Some nice techniques there (including self-modifying code to manage array indexing).
|
23
23
|
:replies: []
|
24
24
|
- :author: alienpirate5
|
25
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ebr7dg/2019_day_17_solutions/fb6xeny
|
25
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ebr7dg/2019_day_17_solutions/fb6xeny
|
26
26
|
:body: |-
|
27
27
|
Ruby: 524/311
|
28
28
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: firetech_SE
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ec8090/2019_day_18_solutions/fbb0sqh
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ec8090/2019_day_18_solutions/fbb0sqh
|
4
4
|
:body: |-
|
5
5
|
[Ruby, 641/396](https://github.com/firetech/advent-of-code/blob/master/2019/18/keymaze.rb)
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: firetech_SE
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ed5ei2/2019_day_20_solutions/fbhgxoo
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ed5ei2/2019_day_20_solutions/fbhgxoo
|
4
4
|
:body: |-
|
5
5
|
[Ruby, 1485/984](https://github.com/firetech/advent-of-code/blob/master/2019/20/donut.rb)
|
6
6
|
|
@@ -13,7 +13,7 @@
|
|
13
13
|
Later, I applied some knowledge and tactics from [day 18](https://www.reddit.com/r/adventofcode/comments/ec8090/2019_day_18_solutions/fbb0sqh/) and started precomputing all the paths between portals (using multiple BFSs), followed by two BFSs (one for part 1 and one for part 2) of the precomputed data, the total runtime came down to a more appealing ~0.2s. :)
|
14
14
|
:replies: []
|
15
15
|
- :author: p_tseng
|
16
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ed5ei2/2019_day_20_solutions/fbg2tm6
|
16
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ed5ei2/2019_day_20_solutions/fbg2tm6
|
17
17
|
:body: |-
|
18
18
|
58/24. The parsing was the bulk of the difficult work, since BFS is already written and ready to go. I got slowed down on part 1 by type errors (can you believe that I have forgotten how to properly add a single list to a list of lists and had to try no fewer than four times before I got it right?), which is what I get for using a language without static type checking. Did much better on part 2 because it only involved adding another bit to the portals found and adding another dimension to state and by that time I had figured out my type issues. Just had to do a bit of debugging to realise that no, I shouldn't allow traveling to negative depths.
|
19
19
|
|
@@ -28,7 +28,7 @@
|
|
28
28
|
Haskell: [20_donut_maze.hs](https://github.com/petertseng/adventofcode-hs-2019/blob/master/bin/20_donut_maze.hs) (Haven't gotten around to adding Dijkstra's to this one yet, so this one's just BFS for now)
|
29
29
|
:replies:
|
30
30
|
- :author: coda_pi
|
31
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ed5ei2/2019_day_20_solutions/fbg6p0s
|
31
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ed5ei2/2019_day_20_solutions/fbg6p0s
|
32
32
|
:body: |-
|
33
33
|
> Part 2 important note: If you ever go into the same portal more than once, you have repeated a previous position but at a deeper depth and thus you are doomed to wander the halls of Pluto for all eternity.
|
34
34
|
|
@@ -53,14 +53,14 @@
|
|
53
53
|
I think it may well be the case that you never need to enter level X where X is the number of portals, though.
|
54
54
|
:replies:
|
55
55
|
- :author: p_tseng
|
56
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ed5ei2/2019_day_20_solutions/fbg9nq1
|
56
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ed5ei2/2019_day_20_solutions/fbg9nq1
|
57
57
|
:body: |-
|
58
58
|
Thanks, confirmed and acknowledged. Correct path through this maze is of length 18, traveling down through BC twice to depth 2 before exiting up through DE and FG. It's what I get for being too clever I guess. I'll strike out the relevant section of my post.
|
59
59
|
|
60
60
|
Note that the map you gave has an interesting property, which is that you can travel from the outer BC portal directly to the inner BC portal. I wonder if it is only the presence of this property that disproves the above principle, and whether the maps given as our inputs lack this property. Or if it has nothing to do with it. I will try to find alternate ways to prove a bound on depth.
|
61
61
|
:replies:
|
62
62
|
- :author: coda_pi
|
63
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ed5ei2/2019_day_20_solutions/fbgdp1c
|
63
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ed5ei2/2019_day_20_solutions/fbgdp1c
|
64
64
|
:body: |-
|
65
65
|
Actually, I don't think there's a linear bound on the depth (as a function of the number of portals) to get to the fastest solution. Indeed, imagine a map like this:
|
66
66
|
|
@@ -95,24 +95,24 @@
|
|
95
95
|
PS This also serves as an example where there's no portal connected directly to itself.
|
96
96
|
:replies:
|
97
97
|
- :author: metalim
|
98
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ed5ei2/2019_day_20_solutions/fbi2caf
|
98
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ed5ei2/2019_day_20_solutions/fbi2caf
|
99
99
|
:body: |-
|
100
100
|
That's interesting. So upper bound of levels is around LCM(a,b) where a+b == number of portals.
|
101
101
|
|
102
102
|
Don't think, however, that Eric did any "gotchas" in this task. He's kind. Have you noticed, that even outer portals in the task are on same range of coordinates as inner portals? No portals in corners. All of this was done to avoid any uncomfortable parsing.
|
103
103
|
:replies: []
|
104
104
|
- :author: "[deleted]"
|
105
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ed5ei2/2019_day_20_solutions/fbg7cdh
|
105
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ed5ei2/2019_day_20_solutions/fbg7cdh
|
106
106
|
:body: |-
|
107
107
|
Nah, whenever you use a portal the second time in the same direction you will end up beeing in the same position as the first time, only some levels deeper. Since start and end are both on level 0 going deeper in levels does not make the solution better.Hence the optimal solution does not have the same portal twice in the same direction in its path.
|
108
108
|
|
109
109
|
I think it would be otherwise if we could use negative levels.
|
110
110
|
:replies:
|
111
111
|
- :author: gedhrel
|
112
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ed5ei2/2019_day_20_solutions/fbg9trb
|
112
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ed5ei2/2019_day_20_solutions/fbg9trb
|
113
113
|
:body: 'I think the post you replied to has a concrete counterexample to this statement. You go out twice on the way to the solution: DE -\>(out)-\> DE -\> FG -\> (out) -\> FG -\> ZZ so you must traverse inwards twice through the BC loop first.'
|
114
114
|
:replies:
|
115
115
|
- :author: "[deleted]"
|
116
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ed5ei2/2019_day_20_solutions/fbgbgyl
|
116
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ed5ei2/2019_day_20_solutions/fbgbgyl
|
117
117
|
:body: Ah, ok, now I understand. Thanks.
|
118
118
|
:replies: []
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: p_tseng
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/edll5a/2019_day_21_solutions/fbllkye
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/edll5a/2019_day_21_solutions/fbllkye
|
4
4
|
:body: |-
|
5
5
|
The story behind this solution is, as usual, twofold:
|
6
6
|
|
@@ -18,7 +18,7 @@
|
|
18
18
|
Now it runs in about 0.7 seconds, which is within my goal. There could be many more possibilities for the custom opcode, but they require further study of the program before I am able to take advantage of them.
|
19
19
|
:replies: []
|
20
20
|
- :author: el_daniero
|
21
|
-
:url: https://www.reddit.com/r/adventofcode/comments/edll5a/2019_day_21_solutions/fbjrxiz
|
21
|
+
:url: https://www.reddit.com/r/adventofcode/comments/edll5a/2019_day_21_solutions/fbjrxiz
|
22
22
|
:body: |-
|
23
23
|
Haven't gotten to part 2 yet, just wanted to share how nicely it works with Ruby's heredoc strings to blend intcode and jumpcode:
|
24
24
|
|
@@ -51,7 +51,7 @@
|
|
51
51
|
Haven't looked at other solutions yet, but I solved part 1 manually. The logic is "if there is a hole on either A B or C, but not on D, then jump". Does onviously not work for part 2, so I'll have to work that one out.
|
52
52
|
:replies: []
|
53
53
|
- :author: Sharparam
|
54
|
-
:url: https://www.reddit.com/r/adventofcode/comments/edll5a/2019_day_21_solutions/fbiol6c
|
54
|
+
:url: https://www.reddit.com/r/adventofcode/comments/edll5a/2019_day_21_solutions/fbiol6c
|
55
55
|
:body: |-
|
56
56
|
## [**Ruby** (366/249)](https://github.com/Sharparam/advent-of-code/blob/master/2019/day21/solution.rb)
|
57
57
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: p_tseng
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ee0rqi/2019_day_22_solutions/fbnm5sc
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ee0rqi/2019_day_22_solutions/fbnm5sc
|
4
4
|
:body: |-
|
5
5
|
Part 1 was not too bad, especially since Ruby has `rotate` function on arrays.
|
6
6
|
|
@@ -20,14 +20,14 @@
|
|
20
20
|
Haskell: [22_slam_shuffle.hs](https://github.com/petertseng/adventofcode-hs-2019/blob/master/bin/22_slam_shuffle.hs)
|
21
21
|
:replies:
|
22
22
|
- :author: Fyvaproldje
|
23
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ee0rqi/2019_day_22_solutions/fbqp1xv
|
23
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ee0rqi/2019_day_22_solutions/fbqp1xv
|
24
24
|
:body: |-
|
25
25
|
In my input, there are no 2 adjacent shuffles of the same type. Are there in yours?
|
26
26
|
|
27
27
|
At first, I also tried the repetitions route...
|
28
28
|
:replies: []
|
29
29
|
- :author: tckmn
|
30
|
-
:url: https://www.reddit.com/r/adventofcode/comments/ee0rqi/2019_day_22_solutions/fbnilun
|
30
|
+
:url: https://www.reddit.com/r/adventofcode/comments/ee0rqi/2019_day_22_solutions/fbnilun
|
31
31
|
:body: |-
|
32
32
|
ruby (plus some mathematica) 91/18
|
33
33
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: rsthau
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/eefva8/2019_day_23_solutions/fbthisd
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/eefva8/2019_day_23_solutions/fbthisd
|
4
4
|
:body: |-
|
5
5
|
Ruby: [both parts](https://topaz.github.io/paste/#XQAAAQBRBAAAAAAAAAA5GUqKNoFH6SMqVwZFsYYqxh4FnZ09RieSSH8z3H6sL03AUlcQkmRnBspAYbyTvczaqGyugOtst3YC3kVpS4F56jNFbmJSnrpqLE9hxeC6BKQA0LPyX/ox6A+hav4qWQ4muJAdqpu70P6TfjJ/nXvlsc5u/twj9HLrvG+pD699I+/OVuFyQ7bGUGGNKQA3z/gIOWuJvpjUpULx0QcIzsJVykfXIsglcsgnVynBcLTUtsYIU1hO2eP+uBACXoAStoj2Fe4kOj0gDjUIFPbJ3paq9Dt9J1YH8RBS3rdYq4txRE+eR1U426ssaSNX/VyuiMn6FtGCEpOyB4kJq53HEQG+ZbmjLZwU+8sl8d/CKjyb1vrm/qjVsqIU/b0+wXbN2vRFL6mOfepRjH5tBKZffcFNJxR1NSj7xKiov3F8B6Ko2LBYeKg5Q/iXBFAtdBYh7byPS7PvM/J5EJZ52cEqcgKxYwN6uzz7kXKYr9/+I/zqLsCs7uUmgo10Ny/t/u/4TZmwtsxrzwIM2F+W/hfJAbHPZtvTfPedP8Gc0mKKOPH7E2xfCySnO3j8QEQ6COz0wIRoqp1Sh/ycHB6Gcn+xJQWn50E+aHqa010rHGPVNZYdQORhwxVMebSevAIRkIzyIY3cGxwXgdZ2Pa7ZYbabnVA9UzEuYZ+v/qmfXA==)
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: p_tseng
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/efca4m/2019_day_25_solutions/fc4qi6w
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/efca4m/2019_day_25_solutions/fc4qi6w
|
4
4
|
:body: |-
|
5
5
|
Solved it day-of with mostly manual playing plus machine assistance (replay a list of moves so that I don't lose all my progress, brute-force the pressure pad). I've since gone back and added some nice bells and whistles to the game player, as follows:
|
6
6
|
|
@@ -30,7 +30,7 @@
|
|
30
30
|
Ruby: [25\_cryostasis.rb](https://github.com/petertseng/adventofcode-rb-2019/blob/master/25_cryostasis.rb)
|
31
31
|
:replies: []
|
32
32
|
- :author: rsthau
|
33
|
-
:url: https://www.reddit.com/r/adventofcode/comments/efca4m/2019_day_25_solutions/fbzpb4q
|
33
|
+
:url: https://www.reddit.com/r/adventofcode/comments/efca4m/2019_day_25_solutions/fbzpb4q
|
34
34
|
:body: |-
|
35
35
|
Ruby: [Code](https://topaz.github.io/paste/#XQAAAQAoBwAAAAAAAAA5GUqKNoFH6SMqVwZFsYYqxh4ExTaLbtf8Alp69UGP9KkSBesmiuVUTdimvKqEHp35RFKztzBU/3FuJv5lldOij8/JmL+Q2WHcQ2y5zCd3FMTB2QOR4oSaHdfg68+rfvTp3WjqEKnUngRyjKlgsL8NxEnXKOBDpzriYeY3qRCQqNNxt1jdGMjJWGzttNCPEZAWwT9c20OyEVP/dmRGJPRlbp9komCqWOQNtHmpFu6v10Qb2awX767abSGKOT3Qui5YZ8EaPN7IvMQCdZPtlN2qfHKzb6TmFeqm6p1WlNCr/2E5o8eR9SEmBALNYIbosLTThyg1JsTaJzTM+dt9gHkG1E3lX0T+vwtVNuXqipmD7jBg4/WZSNDymSifBwjuWg7mflb09TjZdE4lOj+Lu5qS3+IizAdQJ0+YxES3tzBn6qbKOvmTpKh9/NZwW6Bi2yFAoVTOW/VnNBacDOFs8vDG9FE2S6+yKnwWQjnn6DhHDqP2spqMwnJadQgKXz5WQz5YLC4CBnjD4OmQ3HraPN2ioGzjG1dAHCnh22Nx86gNXGD0RHe7Y47TwPgrfXRz64gilLnYH6uTGIMa0Y2JiPLauN6xgaulVWD1sxonlBg8nBU4p9ZXmrI5Jeue3sY6LR7SFEQtJDuB/FlfJpEfNIo6TmHe0RxUzHRQBwOAS5Ao6fQ/1yQX9BRIuIxGnxtLC6Kiz8Yy+P4JtZuqn/0zV1tMZnTN/I9jJdTSlMiY/nv7mUtmLTTelcukouy9b6WvStQqdozCfNoL8df3veLO4sKGzPKCFJaJw0eLspdeCN6FbXo/om+aif3mndfsaJm43ulZPGeGJGg7ZvPZDL/7sroAqYUjlK78jAtQBlsRghtWYqdV1sgaH4HqSr9EwgMnWvjDNiG5X4+P5udHFeeZJu/1jO34jzBYl7XUPFjoFAgqCl2hUA3L6+J7jfCy9jnj6ffaUuPq6ClGqIAMHVU17ru3XhzUkKU+j99wJNH+tfjYZKGp3Y65aB768VqS)
|
36
36
|
|