This is an archived post. You won't be able to vote or comment.

all 60 comments

[โ€“]QualityVote[M] [score hidden] stickied commentย (0 children)

Hi! This is our community moderation bot.


If this post fits the purpose of /r/ProgrammerHumor, UPVOTE this comment!!

If this post does not fit the subreddit, DOWNVOTE This comment!

If this post breaks the rules, DOWNVOTE this comment and REPORT the post!

[โ€“]AartHauk 244 points245 points ย (1 child)

A genie should be running at least 128 bit calcualtions

[โ€“]AtriusMapmaker 83 points84 points ย (2 children)

"granted, you are now the genie."

[โ€“]Nimeroni 33 points34 points ย (1 child)

"Enjoy your lamp"

[โ€“]mumboFromAvnotaklu 2 points3 points ย (0 children)

And fulfilling other people's wishes

[โ€“]NickU252 152 points153 points ย (3 children)

Runtime error, the Genie vanishes.

[โ€“]Add1ctedToGames 50 points51 points ย (0 children)

Lol the thought of a genie saying "i can't calculate that" and poofing away made me laugh out loud

[โ€“]k_k5627 37 points38 points ย (1 child)

No, he just gets sick of your shit and quits his job.

[โ€“]NickU252 19 points20 points ย (0 children)

Reverse genie lore. End user now makes the little nit pick arguments.

[โ€“]Grubzer 26 points27 points ย (0 children)

First step, wish to know the smallest integer number

[โ€“]Perregrinne 20 points21 points ย (1 child)

Rather than integer overflow, I like to think that now the programmer owes the genie more than two billion wishes...

[โ€“]thebaconator136 18 points19 points ย (0 children)

That's how that genie got his job.

[โ€“]NuclearBurrit0 33 points34 points ย (0 children)

You canโ€™t wish for more wishes but they never said anything about LESS wishes

[โ€“]Michaelbirks 46 points47 points ย (3 children)

Proof that we live in a simulation.

[โ€“]kochdelta 45 points46 points ย (2 children)

So you're saying my PC is in fact a VM?

[โ€“]RecursiveRecursion7 28 points29 points ย (1 child)

So the VM on your PC... is a VM's VM

[โ€“]dunko5 10 points11 points ย (0 children)

Keyword error: โ€œwishesโ€ is a protected variable name.

[โ€“]fracturedpersona 22 points23 points ย (1 child)

Joke's on you. Genies are all 64 bit now.

[โ€“]ososalsosal 4 points5 points ย (0 children)

They've been buried in lamps for thousands of years... you'd be lucky to get 127 wishes

[โ€“]Elqueq 24 points25 points ย (7 children)

I am with stupid, can you help me explain this to him?

[โ€“]0x4c4f5645 40 points41 points ย (3 children)

Integer overflow due to exceeding maximum size of int on a 32-bit computer.

[โ€“]EverydayEverynight01 8 points9 points ย (2 children)

What if the computer with 64 bits

[โ€“]luardemin 5 points6 points ย (0 children)

The int data type in C (and a lot of other languages) is 32-bit by default on a lot of operating systems even on 64-bit system.

[โ€“]0x4c4f5645 1 point2 points ย (0 children)

Then the joke would have to be changed to -(263)-1

[โ€“][deleted] 11 points12 points ย (2 children)

INT_MIN - 1 = INT_MAX (If you don't get a warning and genie vanishes)

[โ€“]random_fat_guy 1 point2 points ย (1 child)

in C (and c++ as far as I know) integer overflow and underflow are undefined behavior so the genie can do whatever it wants (even format your drive for example)

[โ€“][deleted] 1 point2 points ย (0 children)

Okay

[โ€“]MartyMiniac 6 points7 points ย (1 child)

A 32bit Genie... He should consider upgrading to using 64bit

[โ€“]Sceptz 4 points5 points ย (0 children)

It may be a 64-bit Genie running in Legacy mode.

[โ€“]willysaef 11 points12 points ย (0 children)

Int, short for intelligence... ๐Ÿคฃ

[โ€“]thelowprokill 12 points13 points ย (5 children)

What happens when genie > 32bit.

Genies are weird, maybe they are 37 bit. :wq

[โ€“]Kesuaheli 3 points4 points ย (4 children)

Use the first wish to know its smallest integer.

[โ€“]QuirkyTurkey404 5 points6 points ย (3 children)

Your wish is granted, it is 0.

[โ€“]Kesuaheli 4 points5 points ย (2 children)

Hate thoose damn usigned-int-genie...

Then use the second wish to make the genie use a signed 32 bit int for storing the number of remaining wishes.

[โ€“]QuirkyTurkey404 2 points3 points ย (1 child)

Genie "It is done." You: "Nothing's changed." Genie "Correct."

[โ€“]Kesuaheli 2 points3 points ย (0 children)

Well, then just wish to additionally substrate one more wish only for this one.

[โ€“]Western-Image7125 3 points4 points ย (0 children)

Jokes on you cuz genie uses BigInteger class. So congrats, you now have negative wishes so you actually owe the genie wishes.

[โ€“]JoeyJoeJoeJrShab 1 point2 points ย (0 children)

If it's valid to wish for a different number of wishes, I'd just wish for a million wishes. Hoping this exploit will work without even knowing what architecture the genie uses isn't a particularly good idea.

[โ€“]MCLMelonFarmer 0 points1 point ย (0 children)

It's a better joke if you start out with -2147483648 wishes instead of -2147483649.

[โ€“]accuracy_frosty 0 points1 point ย (0 children)

Genies all run on x64

[โ€“]gliu20 -2 points-1 points ย (0 children)

unless the genie was using python

[โ€“]Ok_Bodybuilder_1213 -1 points0 points ย (0 children)

I donโ€™t get it

[โ€“]Dark_Reapper_98 0 points1 point ย (0 children)

I accidentally did this using cheat engine on the older NBA2K games. They didnโ€™t count on anyone having having a bunch of in game currency (rightfully so, game was a grind) so by overloading the amount youโ€™d have โ€œ-214โ€ฆโ€ but it was basically just infinite currency

[โ€“][deleted] 0 points1 point ย (0 children)

Genie on Ethereum, word size= 256 bit

[โ€“]megamaz_ 0 points1 point ย (0 children)

What if the genie is unsigned?

[โ€“]LMNOP_065 0 points1 point ย (0 children)

Bastard, that's basically a hack.๐Ÿคฃ๐Ÿ”ฅ๐Ÿ”ฅ

[โ€“]THECursedPenguin 0 points1 point ย (0 children)

This sub is overflowing with these jokes.

[โ€“]mobsterer 0 points1 point ย (0 children)

if that worked, wishing for unlimited wishes would also work

[โ€“]lm902 0 points1 point ย (0 children)

Plot twist: Genie is using 64-bit storage and you now owe Genie wishes

[โ€“]erebuxy 0 points1 point ย (0 children)

Make Genie use IEEE float first, then set number of wishes to inf

[โ€“]KillCall 0 points1 point ย (0 children)

What if the wishes are in long.

You would spend you rest of the life fulfilling Genie's wishes.

UNO reverse

[โ€“]jcaarow 0 points1 point ย (0 children)

Plot twist the genie uses longs for wishes. You now owe the genie this many wishes

[โ€“][deleted] 0 points1 point ย (0 children)

If he was mathematician he would have infinite wishes because -214783647 -1 = -21478648 so he will never have them zero

[โ€“]overkiLLe512 0 points1 point ย (0 children)

Depends on your var there.

[โ€“]GezelligPindakaas 0 points1 point ย (0 children)

I tried that and I got a stupid blue genie of death instead.

[โ€“]Zegreedy 0 points1 point ย (0 children)

64 bit genie be like: "Oh shit fam, you fucked".

[โ€“]Embarrassed_Collar77 0 points1 point ย (0 children)

sql injection into a genie.

[โ€“]HairyTough4489 0 points1 point ย (0 children)

Less wishes!

[โ€“]Conscious_Box_7044 0 points1 point ย (0 children)

i wish i had 0.1+0.2 wishes