Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function barcodeGenerator(input) {
- let startNum = input[0]
- let endNum = input[1]
- let startA = startNum[0];
- let startB = startNum[1];
- let startC = startNum[2];
- let startD = startNum[3];
- let endA = endNum[0];
- let endB = endNum[1];
- let endC = endNum[2];
- let endD = endNum[3];
- let num1 = 0;
- let num2 = 0;
- let num3 = 0;
- let num4 = 0;
- for (let a = startA; a < endA; a++) {
- for (let b = startB; b < endB; b++) {
- for (let c = startC; c < endC; c++) {
- for (let d = startD; d < endD; d++) {
- if (a % 2 !== 0 && a !== 0) {
- num1 = a;
- }
- if (b % 2 !== 0 && b !== 0) {
- num2 = b;
- }
- if (c % 2 !== 0 && c !== 0) {
- num3 = c;
- }
- if (d % 2 !== 0 && d !== 0) {
- num4 = d;
- }
- console.log("" + num1 + num2 + num3 + num4 + " ");
- }
- }
- }
- }
- }
- barcodeGenerator(["2345",
- "6789"])
Advertisement
Add Comment
Please, Sign In to add comment