Skip to content

Commit 2ae3500

Browse files
author
Robb Kidd
committed
yet another doctest
I like them.
1 parent e3c507e commit 2ae3500

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

2021/ruby/day05.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ def to_vent_line(end_coords, skip_diagonals: true)
105105
end
106106
end
107107

108+
# @example upwards & downwards
109+
# d = Day05.new(Day05::EXAMPLE_INPUT)
110+
# d.fill_a_dimension(1, 3) #=> [1, 2, 3]
111+
# d.fill_a_dimension(9, 7) #=> [9, 8, 7]
112+
#
108113
def fill_a_dimension(e1, e2)
109114
e1 > e2 ? e1.downto(e2).to_a : e1.upto(e2).to_a
110115
end

0 commit comments

Comments
 (0)