Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function passwordGenerator(input) {
- let a = Number(input[0]);
- let b = input[1].charCodeAt(0);
- let c = input[2].charCodeAt(0);
- let d = Number(input[3]);
- let e = Number(input[4]);
- let f = Number(input[5]);
- let counter = Number(input[6]);
- for (let i = 1; i <= a; i++) {
- for (let j = 65; j <= b; j++) {
- for (let k = 97; k <= c; k++) {
- for (let l = 1; l <= d; l++) {
- for (let m = 1; m <= e; m++) {
- for (let n = 1; n <= f; n++) {
- if (--counter == 0) {
- console.log(`${ i}${ String.fromCharCode(j)}${ String.fromCharCode(k)}${ l}${ m}${ n}`);
- break;
- }
- }
- if (counter == 0) {
- break;
- }
- }
- if (counter == 0) {
- break;
- }
- }
- if (counter == 0) {
- break;
- }
- }
- if (counter == 0) {
- break;
- }
- }
- if (counter == 0) {
- break;
- }
- }
- console.log("No password on this position");
- }
- Решение c process.exit(0)
- function passwordGenerator(input) {
- let a = Number(input[0]);
- let b = input[1].charCodeAt(0);
- let c = input[2].charCodeAt(0);
- let d = Number(input[3]);
- let e = Number(input[4]);
- let f = Number(input[5]);
- let counter = Number(input[6]);
- for (let i = 1; i <= a; i++) {
- for (let j = 65; j <= b; j++) {
- for (let k = 97; k <= c; k++) {
- for (let l = 1; l <= d; l++) {
- for (let m = 1; m <= e; m++) {
- for (let n = 1; n <= f; n++) {
- if (--counter == 0) {
- console.log(`${ i}${ String.fromCharCode(j)}${ String.fromCharCode(k)}${ l}${ m}${ n}`);
- process.exit(0);
- }
- }
- }
- }
- }
- }
- }
- console.log("No password on this position");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement