Skip to content

Instantly share code, notes, and snippets.

@9cardinals
Created November 8, 2013 05:38
Show Gist options
  • Save 9cardinals/7366722 to your computer and use it in GitHub Desktop.
Save 9cardinals/7366722 to your computer and use it in GitHub Desktop.
simple ruby combination lock
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