Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db = Hash.new
- db['xxx'] = 'yyy'
- db['yyy'] = 'zzz'
- done = false
- while not done
- print 'Enter Username :'
- username = gets.chomp
- print 'Enter Password :'
- password = gets.chomp
- if db[username] == password
- print 'Autentication SucessFull'
- done = true;
- else
- print 'Invalid Credentials'
- puts
- print 'press q to quit or any other key to continue'
- choice = gets.chomp
- if choice.downcase == 'q'
- done = true;
- else
- done = false;
- end
- end
- end
Add Comment
Please, Sign In to add comment