Add more randomness to the answer

This commit is contained in:
Rui Hu 2024-03-13 12:30:58 +08:00
parent 33e04d22dd
commit 45faf97cea

View File

@ -55,7 +55,9 @@ public class PadlockImpl {
List<Integer> answer = new ArrayList<>(numpadSize);
for (int i = 0; i < numpadSize; i++)
answer.add(i);
for (int i = 0; i < numpadSize / 2; i++) {
Collections.shuffle(answer);
}
this.correctPasscode = answer.toArray(new Integer[0]);
}