Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- public class ComboLock
- {
- private int firNum;
- private int secNum;
- private int thiNum;
- private int position;
- public ComboLock(int secret1, int secret2, int secret3)
- {
- firNum = secret1;
- secNum = secret2;
- thiNum = secret3;
- }
- public void reset()
- {
- position = 0;
- }
- public void TurnLeft(int ticks)
- {
- position = ticks;
- }
- public void TurnRight(int ticks)
- {
- position = ticks;
- }
- public boolean open()
- {
- if (position == true)
- {
- open = true;
- }
- else
- {
- position = 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement