Advertisement
detroitdayne

Untitled

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