Created
February 27, 2018 11:42
-
-
Save Nursultan91/d6a8adcf36c7185da9efa924c358b343 to your computer and use it in GitHub Desktop.
Тестовый файл
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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