Skip to content

Instantly share code, notes, and snippets.

@timrogers
Last active August 29, 2015 14:21
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 timrogers/d1d60a954ce6a03d8a60 to your computer and use it in GitHub Desktop.
Save timrogers/d1d60a954ce6a03d8a60 to your computer and use it in GitHub Desktop.
# 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