Hofmaimaier@feddit.org to memes@lemmy.world · 13 days ago8 bit rulefeddit.orgimagemessage-square43linkfedilinkarrow-up1539arrow-down122
arrow-up1517arrow-down1image8 bit rulefeddit.orgHofmaimaier@feddit.org to memes@lemmy.world · 13 days agomessage-square43linkfedilink
minus-squareChozo@fedia.iolinkfedilinkarrow-up28·13 days ago-1 comes from the wish to make the total 0.
minus-squaresga@lemmings.worldlinkfedilinkEnglisharrow-up22·13 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-up18·13 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-213 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.