@[email protected] to Programmer [email protected]English • 23 hours agoMom can we have Scratch? We have scratch at home. Scratch at home:lemmy.mlimagemessage-square7fedilinkarrow-up1195arrow-down11cross-posted to: [email protected]
arrow-up1194arrow-down1imageMom can we have Scratch? We have scratch at home. Scratch at home:lemmy.ml@[email protected] to Programmer [email protected]English • 23 hours agomessage-square7fedilinkcross-posted to: [email protected]
minus-square@jcgAlink2•6 hours agoHuh, I had never considered this solution to fizzbuzz to be honest. I usually go for string concatenation, or (i % 3 == 0 && i % 5 == 0), but yeah i % 15 == 0 is certainly a clever simplification
minus-square@[email protected]linkfedilink1•6 hours agoI think it’s worse at conveying the intention and should be a compile-time simplification (I’m too lazy to check if compilers would do it though).
Huh, I had never considered this solution to fizzbuzz to be honest. I usually go for string concatenation, or (i % 3 == 0 && i % 5 == 0), but yeah i % 15 == 0 is certainly a clever simplification
I think it’s worse at conveying the intention and should be a compile-time simplification (I’m too lazy to check if compilers would do it though).