Keypad lock?

I am attempting to build a keypad lock, and was wondering how I should go about doing it.

how do I set the code (I would want to do it in the programming, not in the setup), and then how should I have it check that code and compare it to the order of the buttons pressed, and make it so that the buttons have to be pressed in that order?


Great, thanks!