this post was submitted on 30 Jul 2025
508 points (96.2% liked)
memes
16588 readers
2446 users here now
Community rules
1. Be civil
No trolling, bigotry or other insulting / annoying behaviour
2. No politics
This is non-politics community. For political memes please go to !politicalmemes@lemmy.world
3. No recent reposts
Check for reposts when posting a meme, you can only repost after 1 month
4. No bots
No bots without the express approval of the mods or the admins
5. No Spam/Ads
No advertisements or spam. This is an instance rule and the only way to live.
A collection of some classic Lemmy memes for your enjoyment
Sister communities
- !tenforward@lemmy.world : Star Trek memes, chat and shitposts
- !lemmyshitpost@lemmy.world : Lemmy Shitposts, anything and everything goes.
- !linuxmemes@lemmy.world : Linux themed memes
- !comicstrips@lemmy.world : for those who love comic stories.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
-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.