We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ae3500 commit 026d174Copy full SHA for 026d174
2021/ruby/day05.rb
@@ -41,14 +41,14 @@ def part2
41
222111....
42
DIAGRAM
43
44
- # @example part 2 diagram
45
- # part2_example_diagram =
46
- # d = Day05.new(Day05::EXAMPLE_INPUT)
47
- # d.to_s #=> Day05::EXAMPLE_DIAGRAM
+ # @example diagram with diagonals
+ # Day05
+ # .new(EXAMPLE_INPUT)
+ # .to_s(skip_diagonals: false) #=> Day05::EXAMPLE_DIAGRAM
48
#
49
- def to_s
+ def to_s(skip_diagonals: true)
50
intersections = parse
51
- .map{ |line| to_vent_line(line, skip_diagonals: false) }
+ .map{ |line| to_vent_line(line, skip_diagonals: skip_diagonals) }
52
.flatten(1)
53
.tally
54
0 commit comments