Last active
September 25, 2019 14:11
-
-
Save Prigin/a3ccc9d8782eb667dc15bf2932c3116b to your computer and use it in GitHub Desktop.
variant 3 (fixed)
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
doc = ARGV[0] | |
doc = "movies.txt" if doc == nil | |
unless File.exist?(doc) | |
puts "no such file" | |
exit | |
end | |
print "[search]> "; search = "Max"; puts search | |
File.foreach(doc) do |line| | |
line = line.split("|") | |
if line[1].include?(search) | |
print line[1] + " | " | |
puts "*" * (line[7].to_f * 10 - 80) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment