Skip to content

Instantly share code, notes, and snippets.

@benatkin
Created May 8, 2009 17:55
Show Gist options
  • Save benatkin/108903 to your computer and use it in GitHub Desktop.
Save benatkin/108903 to your computer and use it in GitHub Desktop.
# Prompts for a password five times, and starting with the second password,
# prints whether the each password matches the first password given.
require 'highline'
firstpass = nil
5.times do
pass = HighLine.new.ask('enter password: ') { |q| q.echo = false }
puts firstpass == pass if firstpass
firstpass ||= pass
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment