Expresar mejor valor rand
This commit is contained in:
1 parent
96e2bed803
commit
bfbbfec86d
1 file changed
+1
-1
@@ -3,7 +3,7 @@ import java.util.Random;
|
|||||||
public class GeneradorContraseñas {
|
public class GeneradorContraseñas {
|
||||||
public static void main(String[] args){
|
public static void main(String[] args){
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
int len = r.nextInt(13-8) + 8; // 8-12
|
int len = r.nextInt(12 + 1 - 8) + 8; // 8-12
|
||||||
for(int i = 0; i < len; i++) {
|
for(int i = 0; i < len; i++) {
|
||||||
switch (r.nextInt(3)) {
|
switch (r.nextInt(3)) {
|
||||||
case 0: // Dígito
|
case 0: // Dígito
|
||||||
|
|||||||
Reference in new issue
Block a user