for durch while Schleife ersetzt

This commit is contained in:
Marc Koch 2020-04-09 13:15:20 +02:00
parent 84ae98a143
commit 1d602b48f0
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@ public class Lottozahlen {
// Lottozahlen ziehen // Lottozahlen ziehen
HashSet<Integer> lottozahlenSet = new HashSet<>(6); HashSet<Integer> lottozahlenSet = new HashSet<>(6);
for (; lottozahlenSet.size() < 6;) { while (lottozahlenSet.size() < 6) {
lottozahlenSet.add((int) (Math.random() * 49) + 1); lottozahlenSet.add((int) (Math.random() * 49) + 1);
} }
ArrayList<Integer> lottozahlen = new ArrayList<>(lottozahlenSet); ArrayList<Integer> lottozahlen = new ArrayList<>(lottozahlenSet);