Advertisement
MattPlummer

Project 8.1

Nov 25th, 2014
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.11 KB | None | 0 0
  1.    
  2.  
  3.     import java.util.Random;
  4.      
  5.     public class CombinationLock
  6.     {
  7.             private int place;
  8.             private int firstNumber;
  9.             private int secondNumber;
  10.             private int thirdNumber;
  11.            
  12.             public CombinationLock(int hidden1, int hidden2, int hidden3)
  13.             {
  14.                     firstNumber = hidden1;
  15.                     secondNumber = hidden2;
  16.                     thirdNumber = hidden3;
  17.             }
  18.             public void TurnRight(int ticks)
  19.             {
  20.                     place = ticks;
  21.             }
  22.             public void TurnLeft(int ticks)
  23.             {
  24.                     place = ticks;
  25.             }
  26.      
  27.             public void reset()
  28.             {
  29.                     place = 0;
  30.             }
  31.      
  32.             public boolean unlocked()
  33.             {
  34.                     if (place == true)
  35.                     {
  36.                             unlocked = true;
  37.                     }
  38.                     else
  39.                     {
  40.                             place = 0;
  41.                     }
  42.             }
  43.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement