...

/

Solution: Printing a Triangle

Solution: Printing a Triangle

Go over the implementation of printing the triangle shape.

Courtney’s version

Press + to interact
count = 0
8.times do
count = count + 1
hashes = "#" * count
puts hashes
end

Explanation

  • Line 1: A variable count is created and initialized with the value zero.

  • Line 2: The do ...