neZnam121

Untitled

Feb 20th, 2022
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function nz(arr1, arr2, arr3, arr4) {
  2.   let firstNumber = arr1;
  3.   let secondtNumber = arr1;
  4.   let thirdNumber = arr1;
  5.   let fourNumber = arr1;
  6.  
  7.   let currentCombination = 0;
  8.  
  9.   for (let K = firstNumber; K <= 8; K++) {
  10.     for (let L = 9; L >= secondNumber; L--) {
  11.       for (let M = thirdNumber; M <= 8; M++) {
  12.         for (let N = 9; N >= fourNumber; N--) {
  13.           if (K == M && L == N && K % 2 == 0 && L % 2 != 0) {
  14.             console.log("Cannot change the same player.");
  15.           } else if (K % 2 == 0 && L % 2 != 0 && M % 2 == 0 && N % 2 != 0) {
  16.             console.log(`${K} ${L} - ${M}${N}`);
  17.             currentCombination++;
  18.           }
  19.           if (currentCombination == 6) {
  20.             break;
  21.           }
  22.         }
  23.         if (currentCombination == 6) {
  24.           break;
  25.         }
  26.       }
  27.       if (currentCombination == 6) {
  28.         break;
  29.       }
  30.     }
  31.     if (currentCombination == 6) {
  32.       break;
  33.     }
  34.   }
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment