this post was submitted on 30 Jul 2025
513 points (96.2% liked)

memes

16691 readers
3289 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
[–] bestelbus22@lemmy.world 32 points 1 week ago (1 children)

Make it -1 you mean. 0 is still a valid uint_8

[–] Chozo@fedia.io 29 points 1 week ago (3 children)

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

[–] sga@lemmings.world 24 points 1 week 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 week 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 week ago* (last edited 1 week 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.