Sentient Loom@sh.itjust.works to Lemmy Shitpost@lemmy.worldEnglish · 2 days agoDon't tell me what to dosh.itjust.worksimagemessage-square5fedilinkarrow-up12arrow-down10
arrow-up12arrow-down1imageDon't tell me what to dosh.itjust.worksSentient Loom@sh.itjust.works to Lemmy Shitpost@lemmy.worldEnglish · 2 days agomessage-square5fedilink
minus-squareSnazz@lemmy.worldlinkfedilinkarrow-up0·edit-22 days agoThere 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; } … }
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; } … }