So I'm creating a code that requires the user to enter a password it has to be 6 digits and not have preceding zeros, the numbers have to be unique as well. I have the first two things down in my code, I need help with making sure that the user cannot repeat numbers.
Have you considered using string to hold the "numbers"? It is much easier to insure a string has a certain length than it is with a number. Also you can then check that each digit is unique.
1. Read the code as a string (not a number).
2. Check that the first character is not '0'.
3. Sort it.
4. Look through it to see if there are any identical character values adjacent to each other.