module Validation DIFFICULTS = { easy: 'easy', medium: 'medium', hell: 'hell' }.freeze def name_valid?(name) name.length.between? 3, 20 end def guess_valid?(guess) /^[1-6]{4}$/.match? guess end def difficult_valid?(difficult) DIFFICULTS.values.include? difficult.downcase end end