Created
September 25, 2020 00:49
-
-
Save mjacobus/adbd541e13da9977903acd80a02ba85b 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
names = File.read(ARGV.first || 'assistencia.txt').split("\n") | |
names = names.sort_by do |name| | |
name.downcase.split(' ').last | |
end | |
present = [] | |
absent = [] | |
names.each do |name| | |
print "#{name} (y/n):" | |
answer = gets.chomp.strip.downcase | |
if answer == 'q' | |
exit | |
end | |
if ['', y].has?(answer) | |
present << name | |
else | |
absent << name | |
end | |
end | |
puts "#{present.count} pessoas assistiram a reunião dentre os regulares. Verifique os não regulares." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment