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