Hofmaimaier@feddit.org to memes@lemmy.world · 8 days ago8 bit rulefeddit.orgimagemessage-square51linkfedilinkarrow-up1557arrow-down122
arrow-up1535arrow-down1image8 bit rulefeddit.orgHofmaimaier@feddit.org to memes@lemmy.world · 8 days agomessage-square51linkfedilink
minus-squarebestelbus22@lemmy.worldlinkfedilinkarrow-up36arrow-down4·8 days agoMake it -1 you mean. 0 is still a valid uint_8
minus-squareChozo@fedia.iolinkfedilinkarrow-up30·8 days ago-1 comes from the wish to make the total 0.
minus-squaresga@lemmings.worldlinkfedilinkEnglisharrow-up24·8 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·8 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-28 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.
Make it -1 you mean. 0 is still a valid uint_8
-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.