Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- public class CombinationLock
- {
- private int place;
- private int firstNumber;
- private int secondNumber;
- private int thirdNumber;
- public CombinationLock(int hidden1, int hidden2, int hidden3)
- {
- firstNumber = hidden1;
- secondNumber = hidden2;
- thirdNumber = hidden3;
- }
- public void TurnRight(int ticks)
- {
- place = ticks;
- }
- public void TurnLeft(int ticks)
- {
- place = ticks;
- }
- public void reset()
- {
- place = 0;
- }
- public boolean unlocked()
- {
- if (place == true)
- {
- unlocked = true;
- }
- else
- {
- place = 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement