Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- puts "Let's check the computer status."
- statusofcomputer = 0 # You start with an unknown computer status.
- puts "Please enter a Username:" #Enter the username.
- username = gets.chomp()
- puts "Welcome #{username}"
- puts "Please enter a code that autheticates you are allowed here."
- password = gets.to_i # Enter the password here.
- password = [soccer, baseball, football, basketball] # This is an array of accepted passwords.
- if password == password[soccer, baseball, football, basketball] # If the password is correct, you get Admin access.
- puts "Welcome Admin."
- puts "You get special access."
- statusofcomputer = 1 # Status you enter.
- elsif password != password[soccer, baseball, football, basketball] # If the password is wrong, you get Guest access.
- puts "Sorry! You get Guest access."
- puts "Maybe next time."
- statusofcomputer = 2 # Status your enter
- end
- if statusofcomputer == 1
- require "/.boolean_admin.rb" # This is what you enter to get admin.
- end
- if statusofcomputer == 2
- require "/.boolean_guest.rb" # This is what you enter to get guest.
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement