Advertisement
Guest User

Main Part

a guest
Apr 28th, 2016
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. puts "Let's check the computer status."
  2. statusofcomputer = 0 # You start with an unknown computer status.
  3.  
  4. puts "Please enter a Username:" #Enter the username.
  5. username = gets.chomp()
  6. puts "Welcome #{username}"
  7.  
  8. puts "Please enter a code that autheticates you are allowed here."
  9. password = gets.to_i # Enter the password here.
  10. password = [soccer, baseball, football, basketball] # This is an array of accepted passwords.
  11.  
  12. if password == password[soccer, baseball, football, basketball] # If the password is correct, you get Admin access.
  13. puts "Welcome Admin."
  14. puts "You get special access."
  15. statusofcomputer = 1 # Status you enter.
  16. elsif password != password[soccer, baseball, football, basketball] # If the password is wrong, you get Guest access.
  17. puts "Sorry! You get Guest access."
  18. puts "Maybe next time."
  19. statusofcomputer = 2 # Status your enter
  20. end
  21.  
  22. if statusofcomputer == 1
  23. require "/.boolean_admin.rb" # This is what you enter to get admin.
  24. end
  25.  
  26. if statusofcomputer == 2
  27. require "/.boolean_guest.rb" # This is what you enter to get guest.
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement