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,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: ffrkAnonymous
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izpf1ub
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izpf1ub
|
4
4
|
:body: |-
|
5
5
|
Ruby
|
6
6
|
|
@@ -9,7 +9,7 @@
|
|
9
9
|
OMG, I thought this was going to be easy. I guess it wasn't _that_ hard in idea, but I was going down the wrong path implementing.
|
10
10
|
:replies: []
|
11
11
|
- :author: kevinluo201
|
12
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izek30g
|
12
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izek30g
|
13
13
|
:body: |-
|
14
14
|
## Ruby version
|
15
15
|
|
@@ -46,7 +46,7 @@
|
|
46
46
|
```
|
47
47
|
:replies: []
|
48
48
|
- :author: tobyaw
|
49
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz95oxy
|
49
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz95oxy
|
50
50
|
:body: |-
|
51
51
|
Ruby
|
52
52
|
|
@@ -74,23 +74,23 @@
|
|
74
74
|
```
|
75
75
|
:replies:
|
76
76
|
- :author: OwnAttention3370
|
77
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz9lik9
|
77
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz9lik9
|
78
78
|
:body: 'Nice implementation. Was wondering about the in operator inside the case statement, I''ve recently started to learn Ruby and haven''t seen it used? I take from the code that is a type of #include? operation on "line"?'
|
79
79
|
:replies:
|
80
80
|
- :author: tobyaw
|
81
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz9mpql
|
81
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz9mpql
|
82
82
|
:body: Pattern matching is a new feature that appeared in recent versions of Ruby. It can match both structure and content of data. A nice explanation is at https://www.bootrails.com/blog/ruby-pattern-matching/
|
83
83
|
:replies:
|
84
84
|
- :author: OwnAttention3370
|
85
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iza2ch6
|
85
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iza2ch6
|
86
86
|
:body: Thank you very much!
|
87
87
|
:replies: []
|
88
88
|
- :author: antoniotto
|
89
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izacxi9
|
89
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izacxi9
|
90
90
|
:body: Thank you, with your solution you finally introduced me this really awesome feature of pattern matching. Is the first time I can understand it.
|
91
91
|
:replies: []
|
92
92
|
- :author: Nnnes
|
93
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz8pk82
|
93
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz8pk82
|
94
94
|
:body: |-
|
95
95
|
# Bash
|
96
96
|
|
@@ -103,7 +103,7 @@
|
|
103
103
|
(edit: moved code to topaz/paste url)
|
104
104
|
:replies: []
|
105
105
|
- :author: philtr
|
106
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izad6e2
|
106
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izad6e2
|
107
107
|
:body: |-
|
108
108
|
**Golf in Ruby** (207 Bytes) ([GitHub](https://github.com/philtr/advent/blob/9e577ee74f97cd80032e4ac6bdf7aeef96e99702/2022/07/golf.rb))
|
109
109
|
|
@@ -114,7 +114,7 @@
|
|
114
114
|
```
|
115
115
|
:replies: []
|
116
116
|
- :author: ignurant
|
117
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izc45xv
|
117
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izc45xv
|
118
118
|
:body: |-
|
119
119
|
Ruby
|
120
120
|
|
@@ -158,7 +158,7 @@
|
|
158
158
|
```
|
159
159
|
:replies:
|
160
160
|
- :author: Steinrikur
|
161
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izcb2af
|
161
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izcb2af
|
162
162
|
:body: |-
|
163
163
|
Dude...
|
164
164
|
|
@@ -167,11 +167,11 @@
|
|
167
167
|
https://www.reddit.com/r/adventofcode/comments/zesk40/comment/izc8p6y/?utm_source=reddit&utm_medium=web2x&context=3
|
168
168
|
:replies:
|
169
169
|
- :author: ignurant
|
170
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izcg6dr
|
170
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izcg6dr
|
171
171
|
:body: Haha. My eyes bulged a bit when my mind transitioned from "I did the same as you, but put the guts all in the same!" to "Okay! We're looking at a bash script! And it ain't an easy one!" haha. I was able to figure it out though with your comment about the same strategy!
|
172
172
|
:replies: []
|
173
173
|
- :author: marshalofthemark
|
174
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz8hrxf
|
174
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz8hrxf
|
175
175
|
:body: |-
|
176
176
|
**Ruby**
|
177
177
|
|
@@ -227,15 +227,15 @@
|
|
227
227
|
```
|
228
228
|
:replies: []
|
229
229
|
- :author: shakdnkashmsna
|
230
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz8i7sj
|
230
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz8i7sj
|
231
231
|
:body: "My solution in [ruby](https://github.com/TessHuelskamp/advent-of-code/commit/2247fd35f99b2143df0bad7cab3d242b77b4ded8)\n\nDespite my commit message, \U0001F605, I’m happy with how this turned out and that I was able to build a fake filesystem in under an hour.\n\nThe global variables were sus \U0001F937\U0001F3FC♀️ but I was a fan of being able to get the “current directory” with `file_system.dig(*path)`"
|
232
232
|
:replies:
|
233
233
|
- :author: epic_gamer_4268
|
234
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz8i8d8
|
234
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz8i8d8
|
235
235
|
:body: when the imposter is sus!
|
236
236
|
:replies: []
|
237
237
|
- :author: '442401'
|
238
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izaqirb
|
238
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izaqirb
|
239
239
|
:body: |-
|
240
240
|
**Ruby**
|
241
241
|
|
@@ -244,7 +244,7 @@
|
|
244
244
|
[Pastie](https://topaz.github.io/paste/#XQAAAQAnBwAAAAAAAAARiEJHiiMzw3cPM/1Vl+2nyBa63n8KxVUKFt2uqWUgrHtviwBEUiCS7kbflCMR6/T17AvBTiCX+UyuSRq93hpk42lxPpKAQsU2IlR4Is3M2E5ontnL76Utv1Ik7F0giELf22oX9AuC+wxokodO6K7a2YF9Zs9r57IQI2TBqOOdSTL6wWNXuV7lpG9pb7I46eBCxDvMcsQzHUT/3v2ccF6alCW27qJkiohN06K39mwEizGG1NNsP/yqlWU88spK4URNAGjfxUu/JZZ+YhTM24Vaal0p87p4jQL3gzErnUtl3I/2E/pUKiZoGyF90zscMe4Acdl2ZZr0lZw7ETrJLxsxutXGMiPeRpgZkThky2i5l4K0Nh2Ow9ogALnRz9u/AFaxJplYzzes0V7lY3PgJdLvKiF0d5pGuyB/o8xDla6ZSUXTuSx0Dgf61K4xJigrWIgNpzISntREtpOTh6GYtSbYgy0rV1Zi4I4SyFBWY0f4Do6Y4lX4W129W6lhPCkbLhE49KDXNSFsfFn6jbXci66RZfgpTjtpjh6UvWlyCT1KDLLTxWZJebRxMcxKnuLfRkXwH4EDzCujhqqlr/LIc33iWsGGYZ/uMIUAOtOfEKUaYP6SSlLh/MQDuqfou1lJpIFIuqT8GCXGI2CcXbOd4pHsaGGBsBxRLuLhCd8MLUbthxVj5ic0UCpwIKPTvdm4Eq7q5qzADaUjCrV7umOzQJKaO0du3/DRakBFs6UxXo6ImOCL5aaFZK3rn8M/xR7GkRXnFt9Krm3T0oAY62YM3P/K2VqFtqIgKUTSL9eNDUZUOVrLxk6IVtOCYd+VA+/j7YTln/jaw43Otx2e2fMrsxlhKuJeblwQ2v8fIJpRX4pPzLorQdKJO24tuS6JCyXOWV4II6alwZ6nN12kuoXZef3h/kBcyl/ju3bFGeabshXr5wHxeOalxFxA8/EPjVPeaUJzyIb/4o/BYKS1E4vtYv/ghNdGRAYE//ZdedGkNekAbgnPmP9E705Vag7F+LTCNY5f/4IL/Fo=)
|
245
245
|
:replies:
|
246
246
|
- :author: ignurant
|
247
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izc4dcx
|
247
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izc4dcx
|
248
248
|
:body: |-
|
249
249
|
I had the same idea of pattern matching on this one! `.split` was just the right move.
|
250
250
|
|
@@ -264,14 +264,14 @@
|
|
264
264
|
```
|
265
265
|
:replies: []
|
266
266
|
- :author: Psilolouben
|
267
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izaui2g
|
267
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izaui2g
|
268
268
|
:body: |-
|
269
269
|
Handling the paths via strings, not a very elegant but it works
|
270
270
|
|
271
271
|
[Ruby](https://github.com/Psilolouben/advent_of_code_2022/blob/master/Day7/aoc7_1.rb)
|
272
272
|
:replies: []
|
273
273
|
- :author: SolarBear
|
274
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izcbkj5
|
274
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izcbkj5
|
275
275
|
:body: |-
|
276
276
|
Ruby solution.
|
277
277
|
|
@@ -280,7 +280,7 @@
|
|
280
280
|
[Source](https://github.com/SolarBear/AdventOfCode2022/blob/main/day7.rb)
|
281
281
|
:replies: []
|
282
282
|
- :author: rsthau
|
283
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz8d5r3
|
283
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz8d5r3
|
284
284
|
:body: |-
|
285
285
|
Ruby. 188/197.
|
286
286
|
|
@@ -323,7 +323,7 @@
|
|
323
323
|
```
|
324
324
|
:replies: []
|
325
325
|
- :author: MuumiJumala
|
326
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz8h2ru
|
326
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz8h2ru
|
327
327
|
:body: |-
|
328
328
|
**Ruby** , pattern matching works wonders on this problem:
|
329
329
|
|
@@ -363,14 +363,14 @@
|
|
363
363
|
```
|
364
364
|
:replies: []
|
365
365
|
- :author: mathem17
|
366
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz8kqd1
|
366
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz8kqd1
|
367
367
|
:body: |-
|
368
368
|
[Ruby 4028/3734](https://github.com/jzhang113/adventofcode/blob/9f57d71a62baf450abd249eb128087851c1d7d17/2022/solutions/07.rb)
|
369
369
|
|
370
370
|
Cleaned up the logic significantly by making the file system an Enumerable, so that we can filter across nodes to collect the ones we want.
|
371
371
|
:replies: []
|
372
372
|
- :author: OlivarTheLagomorph
|
373
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz91blt
|
373
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz91blt
|
374
374
|
:body: |-
|
375
375
|
**Ruby**
|
376
376
|
|
@@ -379,7 +379,7 @@
|
|
379
379
|
Had to get creative with structs and actually build an entire tree of "Directory" and "File" objects. The logic makes total sense to me, but I'm getting a harder time to understand the questions.
|
380
380
|
:replies: []
|
381
381
|
- :author: careyi4
|
382
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz9uoaf
|
382
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/iz9uoaf
|
383
383
|
:body: |-
|
384
384
|
Ruby
|
385
385
|
|
@@ -388,7 +388,7 @@
|
|
388
388
|
Video Walkthrough: [YouTube](https://youtu.be/nVGMu44W0XM)
|
389
389
|
:replies: []
|
390
390
|
- :author: "[deleted]"
|
391
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izbbnqa
|
391
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zesk40/2022_day_7_solutions/izbbnqa
|
392
392
|
:body: |-
|
393
393
|
**Ruby**
|
394
394
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: antoniotto
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zfpnka/2022_day_8_solutions/izrvz8i
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zfpnka/2022_day_8_solutions/izrvz8i
|
4
4
|
:body: |-
|
5
5
|
Part 1 in Ruby
|
6
6
|
|
@@ -40,14 +40,14 @@
|
|
40
40
|
I realize it's really slow. Any suggestions wellcome.
|
41
41
|
:replies: []
|
42
42
|
- :author: Milo33
|
43
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zfpnka/2022_day_8_solutions/izp0p5p
|
43
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zfpnka/2022_day_8_solutions/izp0p5p
|
44
44
|
:body: |-
|
45
45
|
Few days late but my Ruby solution. Happy with this one after only starting with Ruby a week or two ago.
|
46
46
|
|
47
47
|
https://gist.github.com/e-chapin/721520e42b0029665c5e57fa905a431a
|
48
48
|
:replies: []
|
49
49
|
- :author: tobyaw
|
50
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zfpnka/2022_day_8_solutions/ize38wc
|
50
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zfpnka/2022_day_8_solutions/ize38wc
|
51
51
|
:body: |-
|
52
52
|
Ruby
|
53
53
|
|
@@ -72,30 +72,30 @@
|
|
72
72
|
```
|
73
73
|
:replies:
|
74
74
|
- :author: '442401'
|
75
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zfpnka/2022_day_8_solutions/iziubo0
|
75
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zfpnka/2022_day_8_solutions/iziubo0
|
76
76
|
:body: Super elegant.
|
77
77
|
:replies: []
|
78
78
|
- :author: kevinluo201
|
79
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zfpnka/2022_day_8_solutions/izd5hij
|
79
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zfpnka/2022_day_8_solutions/izd5hij
|
80
80
|
:body: "My [Ruby version](https://github.com/kevinluo201/aoc/blob/main/2022/day8/day8.rb)\n\nI use `transpose` for easier fetching `up` and `down` values \U0001F603\n\n```ruby\n grid = []\n File.readlines('input').each do |line|\n break if line == \"\\n\"\n grid << line.chomp.split('').map(&:to_i)\n end\n grid_t = grid.transpose\n\n # part1\n ans = grid.length * 4 - 4\n (1..grid.length - 2).each do |i|\n (1..grid.length - 2).each do |j|\n left = grid[i][0..j - 1].all? { |t| t < grid[i][j] }\n right = grid[i][j + 1..-1].all? { |t| t < grid[i][j] }\n up = grid_t[j][0..i - 1].all? { |t| t < grid[i][j] }\n down = grid_t[j][i + 1..-1].all? { |t| t < grid[i][j] }\n ans += 1 if left || right || up || down\n end\n end\n puts ans\n\n # part2\n ans = 1\n (1..grid.length - 2).each do |i|\n (1..grid.length - 2).each do |j|\n left = grid[i][0..j - 1].reverse.find_index { |t| t >= grid[i][j] }\n left = left ? left + 1 : grid[i][0..j - 1].length\n right = grid[i][j + 1..-1].find_index { |t| t >= grid[i][j] }\n right = right ? right + 1 : grid[i][j + 1..-1].length\n up = grid_t[j][0..i - 1].reverse.find_index { |t| t >= grid[i][j] }\n up = up ? up + 1 : grid_t[j][0..i - 1].length\n down = grid_t[j][i + 1..-1].find_index { |t| t >= grid[i][j] }\n down = down ? down + 1 : grid_t[j][i + 1..-1].length\n\n tmp = left * right * up * down\n ans = tmp if tmp > ans\n end\n end\n puts ans\n```"
|
81
81
|
:replies:
|
82
82
|
- :author: upboats_around
|
83
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zfpnka/2022_day_8_solutions/izd89y2
|
83
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zfpnka/2022_day_8_solutions/izd89y2
|
84
84
|
:body: Nice. `[].max < grid[i][j]` can replace your `.all?` usage in part 1, and `...` excludes the right value of a range so you can do `0...j` instead of `0..j-1`
|
85
85
|
:replies: []
|
86
86
|
- :author: ScaredOfMyRawr
|
87
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zfpnka/2022_day_8_solutions/izehf8e
|
87
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zfpnka/2022_day_8_solutions/izehf8e
|
88
88
|
:body: "[Today's solution in Ruby](https://medium.com/@ashley-peacock/advent-of-code-2022-day-8-solution-treetop-tree-house-55717f6635bf), made a silly mistake, but glad I got there in the end! I did wonder whether depth-first or breadth-first search would be a nice way to do it, especially for the second one..."
|
89
89
|
:replies: []
|
90
90
|
- :author: careyi4
|
91
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zfpnka/2022_day_8_solutions/izei6x0
|
91
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zfpnka/2022_day_8_solutions/izei6x0
|
92
92
|
:body: |-
|
93
93
|
Ruby
|
94
94
|
|
95
95
|
Code: [Github](https://github.com/careyi3/aoc_2022/tree/master/solutions/8)Walkthrough Video: [YouTube](https://youtu.be/WDir-ZdMcK0)
|
96
96
|
:replies: []
|
97
97
|
- :author: arifba
|
98
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zfpnka/2022_day_8_solutions/izdbphp
|
98
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zfpnka/2022_day_8_solutions/izdbphp
|
99
99
|
:body: |-
|
100
100
|
**Ruby**
|
101
101
|
|
@@ -1,38 +1,38 @@
|
|
1
1
|
---
|
2
2
|
- :author: SolarBear
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izlyjk3
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izlyjk3
|
4
4
|
:body: |-
|
5
5
|
Ruby solution! I'm not TOO ashamed, this time.
|
6
6
|
|
7
7
|
https://github.com/SolarBear/AdventOfCode2022/blob/main/day9.rb
|
8
8
|
:replies: []
|
9
9
|
- :author: careyi4
|
10
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izkb13t
|
10
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izkb13t
|
11
11
|
:body: |-
|
12
12
|
Ruby
|
13
13
|
|
14
14
|
Code: [Github](https://github.com/careyi3/aoc_2022/tree/master/solutions/9)Video Walkthrough: [YouTube](https://youtu.be/_OyCRuCSas0)
|
15
15
|
:replies:
|
16
16
|
- :author: TailorSubstantial863
|
17
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izkx7wp
|
17
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izkx7wp
|
18
18
|
:body: |-
|
19
19
|
Another Ruby solution.
|
20
20
|
|
21
21
|
https://github.com/JeffreyMPrice/adventofcode/blob/main/day09/day09.rb
|
22
22
|
:replies:
|
23
23
|
- :author: careyi4
|
24
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izkz1zo
|
24
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izkz1zo
|
25
25
|
:body: Very clean! Nice one
|
26
26
|
:replies: []
|
27
27
|
- :author: SolarBear
|
28
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izlyx66
|
28
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izlyx66
|
29
29
|
:body: |-
|
30
30
|
Here's mine! https://github.com/SolarBear/AdventOfCode2022/blob/main/day9.rb
|
31
31
|
|
32
32
|
It would need a bit of love: it kind of uses an array of knots, kind of uses knots as a linked list... it should do one or the other, but not both.
|
33
33
|
:replies: []
|
34
34
|
- :author: sezvar
|
35
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izhuxry
|
35
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izhuxry
|
36
36
|
:body: |-
|
37
37
|
Ruby, 1881/665
|
38
38
|
|
@@ -97,7 +97,7 @@
|
|
97
97
|
```
|
98
98
|
:replies:
|
99
99
|
- :author: ignurant
|
100
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izi54bp
|
100
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izi54bp
|
101
101
|
:body: |-
|
102
102
|
I had a very similar `dup` deal on day 7 with
|
103
103
|
|
@@ -133,27 +133,27 @@
|
|
133
133
|
As they say: Be warned kids, mutation kills.
|
134
134
|
:replies: []
|
135
135
|
- :author: inolongerwishtotry
|
136
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izm0lfe
|
136
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izm0lfe
|
137
137
|
:body: I just realized I needed to pass a block to `uniq` and it resolved my bug... THANK YOU
|
138
138
|
:replies: []
|
139
139
|
- :author: firetech_SE
|
140
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izhyetz
|
140
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izhyetz
|
141
141
|
:body: "[Ruby](https://github.com/firetech/advent-of-code/blob/%F0%9F%8E%84/2022/09/ropesnake.rb) 3006/1518\n\nFor part 2, I just split out my tail movement code to a function, then called it repeatedly for every new tail part (with the previous part as its head). When it came to test it, I ran it on the first example, got a 1, read the \"However, _be careful_\" warning, thought \"what could possibly go wrong?\", ran it on the real input and submitted the output. It turned out to be correct. First after that I realized there was a second example I could have tested...\n\nAfter writing more bugs than code yesterday, this was a breath of fresh air. Not really sure what \"new types of motion\" I accidentally covered in my part 1 solution. \U0001F605"
|
142
142
|
:replies:
|
143
143
|
- :author: 1234abcdcba4321
|
144
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izhzvdo
|
144
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izhzvdo
|
145
145
|
:body: The additional types of motion are based around the tail segments that the next segment is chasing being able to move diagonally, which can create situations that a part 1 solution _might_ not account for. (Any decently well made one does account for them, though.)
|
146
146
|
:replies:
|
147
147
|
- :author: firetech_SE
|
148
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izi1ko2
|
148
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izi1ko2
|
149
149
|
:body: Ah, of course. Makes sense.
|
150
150
|
:replies: []
|
151
151
|
- :author: ignurant
|
152
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izi3fqk
|
152
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izi3fqk
|
153
153
|
:body: "[Ruby](https://tzarnal.github.io/Opal/#XQAAAQAlBAAAAAAAAAAxmwhIY/U/ZyqQORTuuCkhUaJHymoHcK+ag4DNMs9AcDinEHOmK5LYbr2irf14mpRy7XH4aFkguAJ0VImzcC3PbG//tWeXQPunctFFU5pHUDn58H0bLGNOFQy5fk5OG5G/d6TnOoZBl2Y8BgF4PvU13h7AKHJGMak94aVLleIYywAthnkCahGktGIBTaPwOiNFcHZ6SWWhSChWdhuguBXSFxhlffvj6+GdaZzD1rVwiC/zX0+swSeP1z+A8256l9hXaVqkURcVNpox2SMo2nBKviB+DQCIbyMxTFx5ft9Xp+xeHrFRqGE8RMkXPx2kZKEHSZi5bpEHvwienEAPrVgRfatlRCIihZ7h4j0Hw4aPRkfresCHuHDJILhn4tkE4t0f2BgoMJZx5Bv28TM4Zp1oUatnw/dQsb2QZdZr1PE1F5vpggEKyvXZR8dBnkfFas7BJRgFcF82MUQ3ywmHussE20YMs0+7YbbfBEMMS8oyP366IpOlMLPNbPVE/9cczesMGl5DwVClQiBOotAjg4xEPQefUDVNl5p0m9pPmUGz5ZdbMY+LYQGsZWXK2WZTGKQoRL4p4reIVnYYrDV+7sFfLftoK+NkszYJi+CQ2c4cFMhFyxKpDh9SKhgFg3e/B2wchp6HUWpeQRocd4DD7C66QpH/UivSAA==)"
|
154
154
|
:replies: []
|
155
155
|
- :author: lemon-761
|
156
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izit8h1
|
156
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izit8h1
|
157
157
|
:body: |-
|
158
158
|
Don’t see too many Ruby solutions: [github](https://github.com/timle8n1/aoc/blob/main/aoc2022/day9/solve.rb)
|
159
159
|
|
@@ -162,22 +162,22 @@
|
|
162
162
|
Drawing a picture of a head knot move versus what the tail know should do helped me understand better and apply clamp.
|
163
163
|
:replies:
|
164
164
|
- :author: f4780y
|
165
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izj19tz
|
165
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izj19tz
|
166
166
|
:body: Results are out by +2 from the correct answer for both parts for my input.
|
167
167
|
:replies:
|
168
168
|
- :author: lemon-761
|
169
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izk02t5
|
169
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izk02t5
|
170
170
|
:body: Hmm works fine on both samples and my input file. I’d be happy to try your input.
|
171
171
|
:replies:
|
172
172
|
- :author: f4780y
|
173
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izkjhpl
|
173
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izkjhpl
|
174
174
|
:body: No worries - I've messaged you my input file. Interested to hear if it passes or not, but only if you have time.
|
175
175
|
:replies:
|
176
176
|
- :author: lemon-761
|
177
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izmqlk2
|
177
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izmqlk2
|
178
178
|
:body: I got your same values with that input - maybe clone the repo - I'm also on an older version of ruby? shrug
|
179
179
|
:replies: []
|
180
180
|
- :author: lemon-761
|
181
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izk0ui6
|
181
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zgnice/2022_day_9_solutions/izk0ui6
|
182
182
|
:body: I grabbed another account and it solved both of those parts also.
|
183
183
|
:replies: []
|
@@ -1,13 +1,13 @@
|
|
1
1
|
---
|
2
2
|
- :author: Zaorhion_
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/j0yt14w
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/j0yt14w
|
4
4
|
:body: |-
|
5
5
|
Ruby
|
6
6
|
|
7
7
|
[My Solution](https://github.com/Eric-Philippe/Advent-Of-Code-2022/tree/master/Day10%20%5BRuby%5D%20%F0%9F%A7%A3)
|
8
8
|
:replies: []
|
9
9
|
- :author: BluFoot
|
10
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izqd2az
|
10
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izqd2az
|
11
11
|
:body: |-
|
12
12
|
Ruby, golfed to 118 bytes
|
13
13
|
|
@@ -20,7 +20,7 @@
|
|
20
20
|
```
|
21
21
|
:replies:
|
22
22
|
- :author: ulysse_bn
|
23
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/j0i98y7
|
23
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/j0i98y7
|
24
24
|
:body: |-
|
25
25
|
With a few tweaks, I could get that to 95:
|
26
26
|
|
@@ -33,7 +33,7 @@
|
|
33
33
|
```
|
34
34
|
:replies: []
|
35
35
|
- :author: ffrkAnonymous
|
36
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izq2ga7
|
36
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izq2ga7
|
37
37
|
:body: |-
|
38
38
|
Ruby
|
39
39
|
|
@@ -42,7 +42,7 @@
|
|
42
42
|
This one was fun, and straight forward. Didn't know how to do it using TDD though.
|
43
43
|
:replies: []
|
44
44
|
- :author: tobyaw
|
45
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/iznvdim
|
45
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/iznvdim
|
46
46
|
:body: |-
|
47
47
|
Ruby
|
48
48
|
|
@@ -64,11 +64,11 @@
|
|
64
64
|
```
|
65
65
|
:replies:
|
66
66
|
- :author: f4780y
|
67
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izomns8
|
67
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izomns8
|
68
68
|
:body: Very nice!
|
69
69
|
:replies: []
|
70
70
|
- :author: shandley256
|
71
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izn73dg
|
71
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izn73dg
|
72
72
|
:body: |-
|
73
73
|
**Ruby Solution**
|
74
74
|
|
@@ -79,7 +79,7 @@
|
|
79
79
|
Full Solution: [https://gist.github.com/seanhandley/0f3b78a7c17a459485913692a9296cb1](https://gist.github.com/seanhandley/0f3b78a7c17a459485913692a9296cb1)
|
80
80
|
:replies: []
|
81
81
|
- :author: SolarBear
|
82
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izo3w5h
|
82
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izo3w5h
|
83
83
|
:body: |-
|
84
84
|
**Ruby**
|
85
85
|
|
@@ -88,7 +88,7 @@
|
|
88
88
|
https://github.com/SolarBear/AdventOfCode2022/blob/main/day10.rb
|
89
89
|
:replies: []
|
90
90
|
- :author: careyi4
|
91
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izoa8oc
|
91
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izoa8oc
|
92
92
|
:body: |-
|
93
93
|
Ruby
|
94
94
|
|
@@ -97,7 +97,7 @@
|
|
97
97
|
Video Walkthrough: [YouTube](https://youtu.be/_4BCotKM01U)
|
98
98
|
:replies: []
|
99
99
|
- :author: SnooConfections2453
|
100
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izoqvu7
|
100
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izoqvu7
|
101
101
|
:body: |-
|
102
102
|
I'm having a lot of fun doing ruby one liners. Today's solution is great IMO:
|
103
103
|
|
@@ -106,14 +106,14 @@
|
|
106
106
|
```
|
107
107
|
:replies: []
|
108
108
|
- :author: mathem17
|
109
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izmnv6i
|
109
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izmnv6i
|
110
110
|
:body: |-
|
111
111
|
Ruby 3638/2800: [Code](https://github.com/jzhang113/adventofcode/blob/6e9fa80f9d96d88d5e9faa8867812e886c10e036/2022/solutions/10.rb)
|
112
112
|
|
113
113
|
Spent a bit too long in part 1 wondering if clock edges would matter, but got rewarded in part 2 for just dumping stuff to instance variables lol
|
114
114
|
:replies: []
|
115
115
|
- :author: ni3t
|
116
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izmrrwj
|
116
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izmrrwj
|
117
117
|
:body: |-
|
118
118
|
# Ruby
|
119
119
|
|
@@ -164,14 +164,14 @@
|
|
164
164
|
```
|
165
165
|
:replies: []
|
166
166
|
- :author: RedWingedJerBear
|
167
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izmww0q
|
167
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izmww0q
|
168
168
|
:body: |-
|
169
169
|
[ruby](https://github.com/jwhite-bh/advent-of-code/blob/main/2022/advent_day_10.rb)
|
170
170
|
|
171
171
|
Feel okay about this code
|
172
172
|
:replies: []
|
173
173
|
- :author: kwitczak
|
174
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izmwxv0
|
174
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zhjfo4/2022_day_10_solutions/izmwxv0
|
175
175
|
:body: |-
|
176
176
|
**Ruby**
|
177
177
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: tobyaw
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zifqmh/2022_day_11_solutions/izsmy5e
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zifqmh/2022_day_11_solutions/izsmy5e
|
4
4
|
:body: |-
|
5
5
|
Ruby
|
6
6
|
|
@@ -43,7 +43,7 @@
|
|
43
43
|
```
|
44
44
|
:replies: []
|
45
45
|
- :author: SnooConfections2453
|
46
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zifqmh/2022_day_11_solutions/izrxt9y
|
46
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zifqmh/2022_day_11_solutions/izrxt9y
|
47
47
|
:body: |-
|
48
48
|
Golfed ruby (using eval)
|
49
49
|
|
@@ -65,14 +65,14 @@
|
|
65
65
|
```
|
66
66
|
:replies:
|
67
67
|
- :author: '442401'
|
68
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zifqmh/2022_day_11_solutions/j0n45gv
|
68
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zifqmh/2022_day_11_solutions/j0n45gv
|
69
69
|
:body: |-
|
70
70
|
Very nice.
|
71
71
|
|
72
72
|
`while k[0].any?`saves 2 bytes over`until k[0].empty?`
|
73
73
|
:replies: []
|
74
74
|
- :author: riffraff
|
75
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zifqmh/2022_day_11_solutions/izrf5b5
|
75
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zifqmh/2022_day_11_solutions/izrf5b5
|
76
76
|
:body: |-
|
77
77
|
over engineered OO solution in ruby
|
78
78
|
|
@@ -124,7 +124,7 @@
|
|
124
124
|
I got stuck trying to keep track of all the factors in an array for a long time...
|
125
125
|
:replies: []
|
126
126
|
- :author: 6f937f00-3166-11e4-8
|
127
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zifqmh/2022_day_11_solutions/izrp9w3
|
127
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zifqmh/2022_day_11_solutions/izrp9w3
|
128
128
|
:body: |-
|
129
129
|
**Ruby**
|
130
130
|
|
@@ -188,7 +188,7 @@
|
|
188
188
|
```
|
189
189
|
:replies: []
|
190
190
|
- :author: shandley256
|
191
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zifqmh/2022_day_11_solutions/izryg6k
|
191
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zifqmh/2022_day_11_solutions/izryg6k
|
192
192
|
:body: |-
|
193
193
|
**Solution in Ruby**
|
194
194
|
|
@@ -199,7 +199,7 @@
|
|
199
199
|
https://gist.github.com/seanhandley/9babceb01ed2890a3b390b80e0b2d046#file-advent11-2-rb-L90-L95
|
200
200
|
:replies: []
|
201
201
|
- :author: careyi4
|
202
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zifqmh/2022_day_11_solutions/izs7yis
|
202
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zifqmh/2022_day_11_solutions/izs7yis
|
203
203
|
:body: |-
|
204
204
|
Ruby
|
205
205
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
---
|
2
2
|
- :author: tobyaw
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zjnruc/2022_day_12_solutions/izzcvai
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zjnruc/2022_day_12_solutions/izzcvai
|
4
4
|
:body: |-
|
5
5
|
Ruby
|
6
6
|
|
7
7
|
https://github.com/tobyaw/advent-of-code-2022/blob/master/day\_12.rb
|
8
8
|
:replies: []
|
9
9
|
- :author: careyi4
|
10
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zjnruc/2022_day_12_solutions/izxaq13
|
10
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zjnruc/2022_day_12_solutions/izxaq13
|
11
11
|
:body: |-
|
12
12
|
Ruby
|
13
13
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
- :author: ywgdana
|
3
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zkmyh4/2022_day_13_solutions/j059jee
|
3
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zkmyh4/2022_day_13_solutions/j059jee
|
4
4
|
:body: |-
|
5
5
|
**F#**
|
6
6
|
|
@@ -11,7 +11,7 @@
|
|
11
11
|
[The code at github!](https://github.com/DanaL/AdventOfCode/blob/main/2022/Day13.fsx)
|
12
12
|
:replies: []
|
13
13
|
- :author: Nnnes
|
14
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zkmyh4/2022_day_13_solutions/j00xujm
|
14
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zkmyh4/2022_day_13_solutions/j00xujm
|
15
15
|
:body: |-
|
16
16
|
# Ruby (feat. monkey patching)
|
17
17
|
|
@@ -25,7 +25,7 @@
|
|
25
25
|
Goal was to use Ruby's built-in `<=>`/`sort` with as few modifications as possible. Secondary goal was ~~a mistake~~ to minimize line count without semicolons. Unfortunately, there are some `tap` and `then` that feel a bit too much like using semicolons; anyone have ideas on how to get rid of those without adding more lines?
|
26
26
|
:replies: []
|
27
27
|
- :author: _liquidlemon
|
28
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zkmyh4/2022_day_13_solutions/j00nrhb
|
28
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zkmyh4/2022_day_13_solutions/j00nrhb
|
29
29
|
:body: |-
|
30
30
|
[Ruby](https://github.com/LiquidLemon/advent-of-code/blob/master/2022/13.rb) (759/701)
|
31
31
|
|
@@ -34,15 +34,15 @@
|
|
34
34
|
Really happy I made a function that can be passed to `Array#sort` straight away. Also that part pretty much worked first try, I just had the semantics flipped.
|
35
35
|
:replies:
|
36
36
|
- :author: BluFoot
|
37
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zkmyh4/2022_day_13_solutions/j00qap2
|
37
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zkmyh4/2022_day_13_solutions/j00qap2
|
38
38
|
:body: Nice, I like the use of `<=>`
|
39
39
|
:replies:
|
40
40
|
- :author: _liquidlemon
|
41
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zkmyh4/2022_day_13_solutions/j00reu1
|
41
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zkmyh4/2022_day_13_solutions/j00reu1
|
42
42
|
:body: I had an if with 3 clauses but then I realized there's literally a built in operator for this thing, so why not just use it.
|
43
43
|
:replies: []
|
44
44
|
- :author: marshalofthemark
|
45
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zkmyh4/2022_day_13_solutions/j00puac
|
45
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zkmyh4/2022_day_13_solutions/j00puac
|
46
46
|
:body: |-
|
47
47
|
**Ruby** 1936/1742
|
48
48
|
|
@@ -74,14 +74,14 @@
|
|
74
74
|
```
|
75
75
|
:replies: []
|
76
76
|
- :author: BluFoot
|
77
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zkmyh4/2022_day_13_solutions/j00pxcv
|
77
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zkmyh4/2022_day_13_solutions/j00pxcv
|
78
78
|
:body: |-
|
79
79
|
[Ruby](https://github.com/acornellier/adventofcode/blob/master/2022/13.rb)
|
80
80
|
|
81
81
|
Nice use-case for pattern matching
|
82
82
|
:replies: []
|
83
83
|
- :author: careyi4
|
84
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zkmyh4/2022_day_13_solutions/j01wtnt
|
84
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zkmyh4/2022_day_13_solutions/j01wtnt
|
85
85
|
:body: |-
|
86
86
|
Ruby
|
87
87
|
|
@@ -90,7 +90,7 @@
|
|
90
90
|
Video Walkthrough: [YouTube](https://youtu.be/hpd8cxPfjbY)
|
91
91
|
:replies: []
|
92
92
|
- :author: tobyaw
|
93
|
-
:url: https://www.reddit.com/r/adventofcode/comments/zkmyh4/2022_day_13_solutions/j02o38q
|
93
|
+
:url: https://www.reddit.com/r/adventofcode/comments/zkmyh4/2022_day_13_solutions/j02o38q
|
94
94
|
:body: |-
|
95
95
|
Ruby
|
96
96
|
|