title: Combination lock code
body: <p>I'm trying to solve the old combination lock program. The question is below. I've wrote some code, but so far it only prints a bunch of possible combinations that always contain the first number having 36. I'm honestly super confused as to where to get it to where it needs to be.</p>
  
  <p>"Imagine you need to open a standard combination dial lock but don't know the combination and don't have a pair of bolt cutters. Write a Java program in BlueJ with a method that prints all possible combinations so you can print them on a piece of paper and check off each one as you try it. Assume the numbers on each dial range from zero to thirty-six and three numbers in sequence are needed to open the lock. Suppose the lock isn't a very good one and any number that's no more than two away from the correct number in each digit will also work.  In other words if the combination is 17-6-32, then 18-5-31, 19-4-32, 15-8-33 and many other combinations will also open the lock.  Write another method that prints out a minimal list of combinations you would need to try to guarantee opening the lock. "     </p>
  
  <pre><code>     /**
       * A method that prints all possible combinations of the lock.
       */
      public void combination(int combo)
      {
          int a;
          int b;
          int c;
          a = 0;
          while (a &lt;= 36)
                  {b = 0;
                  while (b &lt;= 36)
                      {c = 0;
                      while (c &lt;= 36)
                      {
                          System.out.println(a + " " + b + " " + c);
                          c = c + 1;
                      }
                      b = b + 1;
                  }
                  a = a + 1;
                  }
      }
  }
  </code></pre>