diff --git a/02_user_interface.rb b/02_user_interface.rb index 1d99b3d..72235b7 100644 --- a/02_user_interface.rb +++ b/02_user_interface.rb @@ -1,29 +1,30 @@ #!/usr/bin/env ruby + LANGUAGES = [ - "ru-RU", - "en-EN", - "de-DE" + "ru-RU", + "en-EN", + "de-DE" ] - def main() - user_name = ARGV[0] - puts "Hello my catgirl #{user_name}! \n What is your love language?" - LANGUAGES.each { |language| puts "#{language}", " " } - user_lang = gets.chomp - user_lang = "ruby" - case user_lang - when "ruby" - puts "Подлиза \n" - when "c++" - puts "MATLAB скушал? \n" - when "TS/JS" - puts "Фронтендер, Фууу! \n" - when "py" - puts "Девопсер, иди ДАГИ писать \n" - end -end + user_name = ARGV[0] + puts "Hello my catgirl #{user_name}! \nWhat is your love language?" + LANGUAGES.each { |language| puts "#{language}", " " } + user_lang = STDIN.gets.chomp -main() + case user_lang + when "ruby" + puts "Подлиза \n" + when "c++" + puts "MATLAB скушал? \n" + when "TS/JS" + puts "Фронтендер, Фууу! \n" + when "py" + puts "Девопсер, иди ДАГИ писать \n" + else + puts "Неизвестный язык: #{user_lang}" + end +end +main()