Stamets@lemmy.dbzer0.com to RPGMemes @ttrpg.network · 15 days agoBard: Get in line. I wish for...lemmy.dbzer0.comimagemessage-square14linkfedilinkarrow-up125arrow-down11
arrow-up124arrow-down1imageBard: Get in line. I wish for...lemmy.dbzer0.comStamets@lemmy.dbzer0.com to RPGMemes @ttrpg.network · 15 days agomessage-square14linkfedilink
minus-squareOzymandias1688@feddit.orglinkfedilinkEnglisharrow-up2·15 days agoThen I wish for 65,536 wishes. The genie crashes with an integer overflow error.
minus-squareddplf@szmer.infolinkfedilinkarrow-up2·15 days agoThere’s no crash, you just go back to 0. Goodbye.
minus-squarethreelonmusketeers@sh.itjust.workslinkfedilinkEnglisharrow-up2·14 days agoIf num_wishes is a signed int, wouldn’t it overflow back to -65536? I suddenly owe the genie a bunch of wishes?
minus-squarebstix@feddit.dklinkfedilinkarrow-up2·14 days agoAll I have to offer is half a bowl of instant noodles, a lawnmower full of grass and toe nail clippings. So Genie, what do you wish for?
minus-squareHugucinogens@lemmy.blahaj.zonelinkfedilinkarrow-up1·14 days agoNah, it doesn’t crash, now you just have to perform 65,535 wishes for the genie.
Then I wish for 65,536 wishes. The genie crashes with an integer overflow error.
There’s no crash, you just go back to 0. Goodbye.
If
num_wishesis a signed int, wouldn’t it overflow back to -65536? I suddenly owe the genie a bunch of wishes?All I have to offer is half a bowl of instant noodles, a lawnmower full of grass and toe nail clippings. So Genie, what do you wish for?
Nah, it doesn’t crash, now you just have to perform 65,535 wishes for the genie.