Stamets@lemmy.dbzer0.com to RPGMemes @ttrpg.network · 20日前Bard: Get in line. I wish for...lemmy.dbzer0.comimagemessage-square14fedilinkarrow-up1131
arrow-up1131imageBard: Get in line. I wish for...lemmy.dbzer0.comStamets@lemmy.dbzer0.com to RPGMemes @ttrpg.network · 20日前message-square14fedilink
minus-squareTar_Alcaran@sh.itjust.workslinkfedilinkarrow-up12·20日前Then I wish for two more wishes. Then I wish that wishes are an absolute value. Then I wish for a million fewer wishes.
minus-squareOzymandias1688@feddit.orglinkfedilinkEnglisharrow-up7·20日前Then I wish for 65,536 wishes. The genie crashes with an integer overflow error.
minus-squareddplf@szmer.infolinkfedilinkarrow-up6·19日前There’s no crash, you just go back to 0. Goodbye.
minus-squarethreelonmusketeers@sh.itjust.workslinkfedilinkEnglisharrow-up3·edit-219日前If 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-up4·19日前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?
minus-squareHugucinogens@lemmy.blahaj.zonelinkfedilinkarrow-up2·edit-219日前Nah, it doesn’t crash, now you just have to perform 65,535 wishes for the genie.
I wish for one unrestricted wish
Then I wish for two more wishes.
Then I wish that wishes are an absolute value.
Then I wish for a million fewer wishes.
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.