• Snazz@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    23 days ago

    There are only 4.29 billion possible values of an int32, so even if you used 2 lines for each case, it’d still be under 10 billion lines of code

    bool isOdd(int num) {
        if (num == 1)
            { return true; }
        if (num == 2)
            { return false; }
        if (num == 3)
            { return true; }
        …
    }