Skip to content

Instantly share code, notes, and snippets.

@Nursultan91
Created February 27, 2018 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nursultan91/d6a8adcf36c7185da9efa924c358b343 to your computer and use it in GitHub Desktop.
Save Nursultan91/d6a8adcf36c7185da9efa924c358b343 to your computer and use it in GitHub Desktop.
Тестовый файл
if ARGV[0] != nil
filename = ARGV[0]
else
filename = File.open("movies.txt", "r")
end
File.readlines(filename).each do |line|
movies = line.split("|")
if movies[1].include? "Max"
rank = (movies[7].to_f*10 - 80).to_i
puts "Title: #{movies[1]}, rank: #{"*"*rank}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment