Guest User

Untitled

a guest
Jan 14th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. db = Hash.new
  2.  
  3. db['xxx'] = 'yyy'
  4. db['yyy'] = 'zzz'
  5.  
  6.  
  7.  
  8. done = false
  9. while not done
  10.  
  11. print 'Enter Username :'
  12. username = gets.chomp
  13.  
  14. print 'Enter Password :'
  15. password = gets.chomp
  16.  
  17.  
  18. if db[username] == password
  19. print 'Autentication SucessFull'
  20. done = true;
  21. else
  22. print 'Invalid Credentials'
  23. puts
  24. print 'press q to quit or any other key to continue'
  25. choice = gets.chomp
  26.  
  27. if choice.downcase == 'q'
  28. done = true;
  29. else
  30. done = false;
  31. end
  32. end
  33.  
  34.  
  35. end
Add Comment
Please, Sign In to add comment