Sundray@lemmus.org to Comic Strips@lemmy.worldEnglish · 3 years agoI AM MISTER SANTAlemmus.orgimagemessage-square20linkfedilinkarrow-up1584arrow-down110file-text
arrow-up1574arrow-down1imageI AM MISTER SANTAlemmus.orgSundray@lemmus.org to Comic Strips@lemmy.worldEnglish · 3 years agomessage-square20linkfedilinkfile-text
minus-squareRentlar@lemmy.calinkfedilinkarrow-up37·3 years agoMr Santa checks if you are naughty || nice to see if you are eligible for a present. Ho ho ho. Everyone is eligible for a present.
minus-squareactiv8r@sh.itjust.workslinkfedilinkarrow-up6·3 years agoNo no no. You’re checking two booleans there. People who are naughty, nice, or both get a present. People who are neither naughty or nice get nothing.
minus-squareHappyFrog@lemmy.blahaj.zonelinkfedilinkarrow-up2·3 years agoWon’t that always come out as true?
minus-squareRentlar@lemmy.calinkfedilinkarrow-up5·3 years agoThat’s correct, hence everyone is eligible.
Mr Santa checks if you are
naughty || niceto see if you are eligible for a present.
Ho ho ho. Everyone is eligible for a present.
No no no. You’re checking two booleans there. People who are naughty, nice, or both get a present. People who are neither naughty or nice get nothing.
But what if naughty = !nice
((nice)? ‘present’ : ‘coal’);
Ash silently weeps.
Won’t that always come out as true?
That’s correct, hence everyone is eligible.
What if you’re neutral?
Mr Santa crashes…