Sjmarf to Programming HumorEnglish • 2 months agoCompareBooleanssh.itjust.worksimagemessage-square97fedilinkarrow-up1514arrow-down19
arrow-up1505arrow-down1imageCompareBooleanssh.itjust.worksSjmarf to Programming HumorEnglish • 2 months agomessage-square97fedilink
minus-square@XanviallinkEnglish9•2 months agoyou can also use XOR operation return (X || Y) && !(X && Y)
minus-square@ActerslinkEnglish2•edit-22 months agoI was debating on bitwise operations, but decided on super basic if statements which I think the compiler would optimize, happy to see the logical operation form too
you can also use XOR operation
return (X || Y) && !(X && Y)
I was debating on bitwise operations, but decided on super basic if statements which I think the compiler would optimize, happy to see the logical operation form too