Last active
August 29, 2015 14:21
-
-
Save timrogers/d1d60a954ce6a03d8a60 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Load the authors from a text file of names, with one on each line... | |
path = ARGV[0] | |
authors = File.read(path).lines | |
# ...or just define them inline | |
authors = %w(foo bar baz) | |
def test_me_on(authors) | |
starred = [] | |
authors.shuffle.each_with_index do |author, index| | |
puts "#{index + 1}/#{authors.count}. #{author}" | |
starred.push(author) if $stdin.gets.chomp == "*" | |
end | |
puts "*** And now for some of them again... ***\n" | |
test_me_on(starred) | |
puts "*** All done! ***" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment