Z15966

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z15966"
    },
    "Z2K2": {
        "Z1K1": "Z14",
        "Z14K1": "Z15965",
        "Z14K3": {
            "Z1K1": "Z16",
            "Z16K1": "Z600",
            "Z16K2": "function Z15965(Z15965K1) {\r\n    function spell_block(x) {\r\n        const integers_spellings_list = [\"\", \"jeden\", \"dwa\", \"trzy\", \"cztery\", \"pięć\", \"sześć\", \"siedem\", \"osiem\", \"dziewięć\"];\r\n        const teens_spellings_list = [\"\", \"jedenaście\", \"dwanaście\", \"trzynaście\", \"czternaście\", \"piętnaście\", \"szesnaście\", \"siedemnaście\", \"osiemnaście\", \"dziewiętnaście\"];\r\n        const tys_spellings_list = [\"\", \"dziesięć\", \"dwadzieścia\", \"trzydzieści\", \"czterdzieści\", \"pięćdziesiąt\", \"sześćdziesiąt\", \"siedemdziesiąt\", \"osiemdziesiąt\", \"dziewięćdziesiąt\"];\r\n        const hundreds_spellings_list = [\"\", \"sto\", \"dwieście\", \"trzysta\", \"czterysta\", \"pięćset\", \"sześćset\", \"siedemset\", \"osiemset\", \"dziewięćset\"];\r\n\r\n        let hundreds_spelling = \"\", tens_and_ones_spelling = \"\", tens_spelling = \"\", ones_spelling = \"\";\r\n        const hundreds = x / 100n;\r\n        if(hundreds != 0n) {\r\n            hundreds_spelling = hundreds_spellings_list[hundreds];\r\n        }\r\n\r\n        const tens_and_ones = x % 100n;\r\n        if(tens_and_ones \u003E= 11n \u0026\u0026 tens_and_ones \u003C= 19n) {\r\n            tens_and_ones_spelling = teens_spellings_list[tens_and_ones - 10n];\r\n        } else {\r\n            const tens = tens_and_ones / 10n;\r\n            const ones = tens_and_ones % 10n;\r\n            if(tens != 0n) {\r\n                tens_spelling = tys_spellings_list[tens];\r\n            }\r\n            if(ones != 0n) {\r\n                ones_spelling = integers_spellings_list[ones];\r\n            }\r\n            if(tens_spelling != \"\" \u0026\u0026 ones_spelling != \"\") {\r\n                tens_and_ones_spelling = tens_spelling + \" \" + ones_spelling;\r\n            } else if(tens_spelling != \"\" \u0026\u0026 ones_spelling == \"\") {\r\n                tens_and_ones_spelling = tens_spelling;\r\n            } else if(tens_spelling == \"\" \u0026\u0026 ones_spelling != \"\") {\r\n                tens_and_ones_spelling = ones_spelling;\r\n            }\r\n        }\r\n\r\n        if(hundreds_spelling != \"\" \u0026\u0026 tens_and_ones_spelling != \"\") {\r\n            return hundreds_spelling + \" \" + tens_and_ones_spelling;\r\n        } else {\r\n            return hundreds_spelling + tens_and_ones_spelling;\r\n        }\r\n    }\r\n\r\n    var x = Z15965K1;\r\n\r\n    var blocks_names =\r\n        [\r\n            [\"\", \"\", \"\"],\r\n            [\"tysiąc\", \"tysiące\", \"tysięcy\"],\r\n        ];\r\n    for (const prefix of [\"mi\", \"bi\", \"try\", \"kwadry\", \"kwinty\", \"seksty\", \"septy\", \"okty\", \"nony\", \"decy\"]) {\r\n        blocks_names.push([\r\n            prefix + \"lion\",\r\n            prefix + \"liony\",\r\n            prefix + \"lionów\"\r\n        ]);\r\n        blocks_names.push([\r\n            prefix + \"liard\",\r\n            prefix + \"liardy\",\r\n            prefix + \"liardów\"\r\n        ]);\r\n    }\r\n    var blocks_spelling = [];\r\n\r\n    if(x == 0n) {\r\n        blocks_spelling.push(\"zero\");\r\n    } else {\r\n        let x_remainder = x;\r\n        for(var i = 0; i != blocks_names.length; i++) {\r\n            var cur_block = x_remainder % 1000n;\r\n            var last_two_digits = cur_block % 100n;\r\n            var last_digit = cur_block % 10n;\r\n            x_remainder = x_remainder / 1000n;\r\n            var cur_block_spelling = spell_block(cur_block);\r\n            if(cur_block_spelling != \"\") {\r\n                var plural_case_id;\r\n                if(cur_block == 1n) {\r\n                    plural_case_id = 0;\r\n                } else if((last_digit == 2n || last_digit == 3n || last_digit == 4n) \u0026\u0026 last_two_digits != 12n \u0026\u0026 last_two_digits != 13n \u0026\u0026 last_two_digits != 14n) {\r\n                    plural_case_id = 1;\r\n                } else {\r\n                    plural_case_id = 2;\r\n                }\r\n\r\n                var oom_spelling = blocks_names[i][plural_case_id];\r\n                if (oom_spelling != \"\" \u0026\u0026 cur_block_spelling != \"jeden\") {\r\n                    cur_block_spelling += \" \" + oom_spelling;\r\n                } else if (oom_spelling != \"\" \u0026\u0026 cur_block_spelling == \"jeden\") {\r\n                    cur_block_spelling = oom_spelling;\r\n                }\r\n                blocks_spelling.push(cur_block_spelling);\r\n            }\r\n        }\r\n    }\r\n\r\n    return blocks_spelling.reverse().join(\" \");\r\n}"
        }
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11",
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1332",
                "Z11K2": "JavaScript implemetation for Z15965"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Polish cardinal, javascript"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1025",
                "Z11K2": "liczebnik główny po polsku, JavaScript"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1014",
                "Z11K2": "Kadịnal Polish, javascript"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1004",
                "Z11K2": "cardinal en polonais, en JavaScript"
            },
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1430",
                "Z11K2": "Polnisches Zahlwort in JavaScript"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            "Z31"
        ]
    },
    "Z2K5": {
        "Z1K1": "Z12",
        "Z12K1": [
            "Z11"
        ]
    }
}