Ruby provides a number of ways to get input from the user. we will use gets in this example. The gets method is basically the opposite of puts — instead of printing stuff, it gathers what the user types for you. puts "Welcome to Shapes"
After print statement, collect the user’s input into a variable (shape_size):
print "How big do you want your shape? "
print "How big do you want your shape? "
shape_size = gets
How to create two dimensional array in ruby?
how to create an array with Array.[](*args) in Ruby ?
Ruby program to print an array
Program to Print Triangle of Numbers in Ruby
Ruby program to Calculate the factorial of given number
How to add/remove elements to Array in Ruby?
What are the various Ruby runtimes, and how are they different?
What are some of your favorite gems? What are their alternatives?
Ruby program to check whether the given number is Armstrong
Ruby program to add two integer numbers
How to Sort Array in Ruby?
Ruby program to check whether the given number is prime or not
Ruby program to generate random numbers
What's the difference between a lambda, a block and a proc?
Ruby program to check whether the given number is palindrome
How to Replace array elements in Ruby?
Ruby program to reverse a string
How to shuffle an array in Ruby?
What are #method_missing and #send? Why are they useful?
Ruby program to print Fibonacci series
Creating Array with Array.new(size, obj) in Ruby
How to get index of array element in Ruby
How to Get Input with Gets in Ruby