this post was submitted on 30 Jul 2025
520 points (96.3% liked)

memes

17365 readers
2505 users here now

Community rules

1. Be civilNo trolling, bigotry or other insulting / annoying behaviour

2. No politicsThis is non-politics community. For political memes please go to !politicalmemes@lemmy.world

3. No recent repostsCheck for reposts when posting a meme, you can only repost after 1 month

4. No botsNo bots without the express approval of the mods or the admins

5. No Spam/Ads/AI SlopNo advertisements or spam. This is an instance rule and the only way to live. We also consider AI slop to be spam in this community and is subject to removal.

A collection of some classic Lemmy memes for your enjoyment

Sister communities

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] Chozo@fedia.io 29 points 1 month ago (3 children)

-1 comes from the wish to make the total 0.

[–] sga@lemmings.world 24 points 1 month ago

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

[–] Jerkface@lemmy.world 18 points 1 month ago

Updating the balance after granting the wish is bad practice. This genie is begging for a reentrancy attack.

[–] bestelbus22@lemmy.world 6 points 1 month ago* (last edited 1 month ago)

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.