Created
November 8, 2013 05:38
-
-
Save 9cardinals/7366722 to your computer and use it in GitHub Desktop.
simple ruby combination lock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def lock(key1,key2,key3,key4) | |
if | |
(key1 == 3 || key1 == 5 || key1 == 7) && (key2 == 2) && (key3 == 5 || key3 == 6) && (key4 == 8 || key4 == 9 || key4 == 0) | |
then | |
"unlocked" | |
else | |
"locked" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment