Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function substitute(input) {
- let counter = 0;
- for (let k = Number(input[0]); k < 9; k++) {
- for (let l = 9; l >= Number(input[1]); l--) {
- for (let m = Number(input[2]); m < 9; m++) {
- for (let n = 9; n >= Number(input[3]); n--) {
- if (k % 2 === 0 && m % 2 === 0 && l % 2 === 1 && n % 2 === 1) {
- if (k === m && l === n) {
- console.log("Cannot change the same player.");
- } else {
- console.log(`${k}${l} - ${m}${n}`);
- if (++counter === 6) {
- return;
- }
- }
- }
- }
- }
- }
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement