Skip to content

Commit 6d8366f

Browse files
committed
Printed the asterisks to show a triangle grid
1 parent 3c9d5d9 commit 6d8366f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

exercises/print_triangle.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ def print_line(count)
2323
end
2424

2525
def print_triangle(height)
26-
# You have to fill in the details here.
26+
(1..height).each do |i| # or, equivalently, for i in (1..height)
27+
print_line(i) # I called the print_line method on the print_triangle method using each item on print_triangle as arguement. I don't know what its called. It just works ;). I acctually solved this by mistake, trying to solve print_square.rb
28+
29+
end
30+
2731
end
2832

2933
# There are no rumble strips this time. It's up to you to decide whether

0 commit comments

Comments
 (0)