```var pile, lefthand, righthand, fingers, line; var oldyin = 0, oldyang = 0, youngyin = 0; youngyang = 0, count = 0; var a, b, c, pileb, pilec, lineb, linec; for(a = 2; a < 49; a++) { pile = 50 - 1; line = 0; righthand = a; lefthand = pile - righthand; fingers = 1; righthand--; fingers += (lefthand % 4 == 0 ? 4 : lefthand % 4); fingers += (righthand % 4 == 0 ? 4 : righthand % 4); pileb = pile - fingers; line = (fingers == 9 || fingers == 8 ? 2 : 3); for(b = 2; b < pileb; b++) { righthand = b; lefthand = pileb - righthand; fingers = 1; righthand--; fingers += (lefthand % 4 == 0 ? 4 : lefthand % 4); fingers += (righthand % 4 == 0 ? 4 : righthand % 4); pilec = pileb - fingers; lineb = (fingers == 9 || fingers == 8 ? 2 : 3); for(c = 2; c < pilec; c++) { righthand = c; lefthand = pilec - righthand; fingers = 1; righthand--; fingers += (lefthand % 4 == 0 ? 4 : lefthand % 4); fingers += (righthand % 4 == 0 ? 4 : righthand % 4); linec = (fingers == 9 || fingers == 8 ? 2 : 3); console.log(a + ", " + b + ", " + c + ":"); if (line + lineb + linec == 6) {console.log("Old Yin"); oldyin++;} if (line + lineb + linec == 7) {console.log("Young Yang"); youngyang++;} if (line + lineb + linec == 8) {console.log("Young Yin"); youngyin++;} if (line + lineb + linec == 9) {console.log("Old Yang"); oldyang++;} count++; } } } console.log("Old Yin: " + oldyin + "/" + count); console.log("Young Yang: " + youngyang + "/" + count); console.log("Young Yin: " + youngyin + "/" + count); console.log("Old Yang: " + oldyang + "/" + count); ```