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?
Ruby program to add two integer numbers
how to create an array with Array.[](*args) in Ruby ?
Creating Array with Array.new(size, obj) in Ruby
Ruby program to print an array
What are some of your favorite gems? What are their alternatives?
Ruby program to generate random numbers
How to Get Input with Gets in Ruby
Ruby program to Calculate the factorial of given number
How to Replace array elements in Ruby?
How to get index of array element in Ruby
How to add/remove elements to Array in Ruby?
How to shuffle an array in Ruby?
How to Sort Array in Ruby?
Ruby program to print Fibonacci series
Ruby program to reverse a string
Ruby program to check whether the given number is Armstrong
Ruby program to check whether the given number is prime or not
What's the difference between a lambda, a block and a proc?
Program to Print Triangle of Numbers in Ruby
What are the various Ruby runtimes, and how are they different?
What are #method_missing and #send? Why are they useful?
Ruby program to check whether the given number is palindrome