I want the user to enter their style of beard and then I will have it checked against a list of beards in an array of style of beards. This is something extra I wanted to do and i'm not sure how to work it out. The only item I came across to something close to it is the (include?) but I want to have:
(array name).include? (value input from user)
require_relative 'list_of'
require_relative 'error'
#User inputs a value
def get_beard
puts "What style of beard do you have?"
beard = gets
if check_beard_ok?(beard)
then no_problem(beard) end
end
#Value passed to check length doesn't exceed 25 letters
def check_beard_ok?(beard)
# while beard.length < 25
# beard.in?(beard_style)
# end
end
#The value is printed here without any errors occuring
def no_problem(beard)
puts "\nYou have a " + beard
puts "\nThere are other beards that you could try like..."
list_of
end
get_beard