Solutions: Printing Shapes Exercises
Understand how to print shapes in Ruby by exploring solutions for a rhombus, hollow square, and heart. Learn to use loops, conditional logic, and spacing calculations to create these patterns.
We'll cover the following...
We'll cover the following...
Print a rhombus
Explanation
Line 4: We subtracted the current row’s value from the total number of rows to calculate spaces. Note that we also subtracted an additional
1...