Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function nz(arr1, arr2, arr3, arr4) {
- let firstNumber = arr1;
- let secondtNumber = arr1;
- let thirdNumber = arr1;
- let fourNumber = arr1;
- let currentCombination = 0;
- for (let K = firstNumber; K <= 8; K++) {
- for (let L = 9; L >= secondNumber; L--) {
- for (let M = thirdNumber; M <= 8; M++) {
- for (let N = 9; N >= fourNumber; N--) {
- if (K == M && L == N && K % 2 == 0 && L % 2 != 0) {
- console.log("Cannot change the same player.");
- } else if (K % 2 == 0 && L % 2 != 0 && M % 2 == 0 && N % 2 != 0) {
- console.log(`${K} ${L} - ${M}${N}`);
- currentCombination++;
- }
- if (currentCombination == 6) {
- break;
- }
- }
- if (currentCombination == 6) {
- break;
- }
- }
- if (currentCombination == 6) {
- break;
- }
- }
- if (currentCombination == 6) {
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment