Hofmaimaier@feddit.org to memes@lemmy.world · 10 days ago8 bit rulefeddit.orgimagemessage-square51linkfedilinkarrow-up1558arrow-down122
arrow-up1536arrow-down1image8 bit rulefeddit.orgHofmaimaier@feddit.org to memes@lemmy.world · 10 days agomessage-square51linkfedilink
minus-squareChozo@fedia.iolinkfedilinkarrow-up30·10 days ago-1 comes from the wish to make the total 0.
minus-squaresga@lemmings.worldlinkfedilinkEnglisharrow-up23·10 days agobut they asked for 0! = 1 wishes, so it should be 1 - 1 = 0 wishes remaining, and not 0 - 1 = -1 sorry, but i had to !unexpectedfactorial@sopuli.xyz
minus-squareJerkface@lemmy.worldlinkfedilinkarrow-up20·10 days agoUpdating the balance after granting the wish is bad practice. This genie is begging for a reentrancy attack.
minus-squarebestelbus22@lemmy.worldlinkfedilinkarrow-up6·edit-210 days agoIf the genie knows the wish counter automatically decrements after every wish execution, he should set the wish counter to 1 to fullfill a total of 0 wishes. But since he’s a genie I’m sure he has unrestricted rights to modify the wish counter.
-1 comes from the wish to make the total 0.
but they asked for 0! = 1 wishes, so it should be 1 - 1 = 0 wishes remaining, and not 0 - 1 = -1
sorry, but i had to !unexpectedfactorial@sopuli.xyz
Updating the balance after granting the wish is bad practice. This genie is begging for a reentrancy attack.
If the genie knows the wish counter automatically decrements after every wish execution, he should set the wish counter to 1 to fullfill a total of 0 wishes. But since he’s a genie I’m sure he has unrestricted rights to modify the wish counter.