Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function generator(input) {
- let a = Number(input[0]);
- let b = Number(input[1]);
- let numberOfPass = Number(input[2]);
- let output = '';
- let count = 1;
- let aA = 35;
- let bB = 64;
- for (let x = 1; x <= a; x++) {
- for (let y = 1; y <= b; y++) {
- output += `${String.fromCharCode(aA)}${String.fromCharCode(bB)}${x}${y}${String.fromCharCode(bB)}${String.fromCharCode(aA)}|`;
- count++;
- aA++;
- bB++;
- if (aA > 55) {
- aA = 35;
- }
- if (bB > 96) {
- bB = 64;
- }
- if (count > numberOfPass) {
- console.log(output);
- return;
- }
- }
- }
- console.log(output);
- }
Add Comment
Please, Sign In to add comment