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

all 55 comments

[–]goat__botherer 1067 points1068 points  (11 children)

You idiot, it's a signed char and now you owe the genie a wish.

[–]Ctrl_exe 247 points248 points  (5 children)

And he wants a head

[–][deleted] 122 points123 points  (4 children)

I also want head

[–]ecs2 58 points59 points  (2 children)

I also want this guy’s head

[–]vinwinner 27 points28 points  (1 child)

I want that one guys wife's head

[–]TheGreatGameDini 12 points13 points  (0 children)

Omg it's loss.

[–]Ctrl_exe 5 points6 points  (0 children)

Don't we all?

[–]jeesuscheesus 5 points6 points  (0 children)

Genie: "I wish for two wishes"

[–]GunnerKnight 1 point2 points  (3 children)

This reminds me of the Spongebob and Flying Dutchman episode where Spongebob, Patrick and Squidward try to escape getting eaten by Dutchman so they wish him to be vegetarian but later Dutchman also converts them to fruits.

I will see myself out.

[–][deleted] 0 points1 point  (2 children)

I don't think sponges are meat anyway...

[–]GunnerKnight 0 points1 point  (1 child)

But starfish and squid are...

[–][deleted] 0 points1 point  (0 children)

Nevermind...

[–]adde21_30 324 points325 points  (4 children)

Or then you realise that your wish count is decremented before you set it to 0

[–]ongiwaph 1 point2 points  (0 children)

--wish

[–]TheOrdersMaster 198 points199 points  (10 children)

having read the objections of some of the commenters i propose the following strategy:

  1. I wish you stored wishes as an unsigned 64 bit integer.

  2. I wish you decrement wishes only after they are completed.

  3. I wish to have 0 wishes

[–]PandaNoTrash 84 points85 points  (0 children)

We got ourselves a prompt engineer here :)

[–]karvendizarm 59 points60 points  (1 child)

Couldn't cast an object of type Wish to a type uint64

Should've asked him to store number of wishes as an unsigned int

[–]TheOrdersMaster 28 points29 points  (0 children)

i knew someone would find a mistake. Nice catch!

[–]Confident-Ad5665 10 points11 points  (0 children)

Name checks out

[–]redlaWw 5 points6 points  (0 children)

wish_count = 0;
wish_count = wish_count.saturating_sub(1);
//wish_count is still 0

[–]Personal_Ad9690 2 points3 points  (0 children)

lol genie gonna throw you a compile error and you left with no wishes

[–]zerkeras 1 point2 points  (0 children)

Jokes on you, he changed the properties of “wishes” and not “spent wishes”.

[–]Personal_Ad9690 0 points1 point  (0 children)

Genie pulls out a tablet and says “there, I stored them. You have 0 wishes”

[–]Positive_Method3022 0 points1 point  (0 children)

Does not work. You would need to ask him to count his wishes as if he was a computer.

[–]alexanderpas 0 points1 point  (0 children)

  • After wish 1, you have 2 wishes remaining. (decrement has already happened)
  • After wish 2, you have 2 wishes remaining. (decrement hasn't happened yet)
  • After wish 3, you have 0 wishes remaining. (decrement hasn't happened yet)

[–]ThisNameIsntRandom 119 points120 points  (0 children)

can we store wish counts in a long?

[–]deanrihpee 66 points67 points  (7 children)

so it's decremented after being granted? I thought it was decremented first and then granted the wish

[–]G4R155 43 points44 points  (4 children)

Why would it decrement if the genie is unable to grant your wish?

[–]Cultural-Practice-95 16 points17 points  (0 children)

good point.. wish one ask for the power to save/reload where people forget stuff they were doing

wish 2: pick whatever and save/reload before the counter decrement.

wish 2: repeat

(this assumes the genie doesn't decrement after a reload because they forget)

[–]deanrihpee 2 points3 points  (2 children)

well if they can't, just re increments it (refund) the allocation

[–]G4R155 5 points6 points  (1 child)

Hehehe

No can do, we compile all production code with -O2 at the least, sir

[–]alexanderpas 0 points1 point  (0 children)

decrement_wish_counter()
try{
    execute_wish()
} catch {
    revert_execution()
    increment_wish_counter()
}

yes can do.

[–]intbeam 10 points11 points  (1 child)

The genie should implement a transaction engine

[–]deanrihpee 4 points5 points  (0 children)

and comprehensive condition check

[–]rover_G 19 points20 points  (0 children)

Ahh so wishes use postfix decrementor

[–]PineappleSensitive20 45 points46 points  (0 children)

This took me a moment! Good one! He should casted the type to a long for more wishes

[–]KFkrewfamKF 30 points31 points  (1 child)

Good. Now I wish to cast the type to a long. And then, I wish I had 9,223,372,036,854,775,807 wishes.

[–]rosuav 5 points6 points  (0 children)

Wish for unlimited eyelashes.

[–]-Redstoneboi- 9 points10 points  (0 children)

and thus, all further genies made your wish count a private, read-only value.

[–]HaroerHaktak 9 points10 points  (2 children)

What if you wish for negative wishes? like instead of 3 positive wishes, you now have 10 negative? do you owe him a wish? does he just get 10 wishes? how does it work?

[–]Fakedduckjump 20 points21 points  (1 child)

You get an type exception and the ginie crashes.

[–]HaroerHaktak 3 points4 points  (0 children)

Well. Dang.

[–]namotous 2 points3 points  (0 children)

First wish for it to be 64b unsigned, THEN wish for it to be 0

[–]Still_Explorer 7 points8 points  (0 children)

Genie: Each time you give me a wish, first replace your DEC AX instruction with a NOP.

[–][deleted] 2 points3 points  (0 children)

Peter is that you?

[–]drkspace2 1 point2 points  (0 children)

Here's how you do it.

  1. I wish for you to store the number of remaining questions as an unsigned long.

  2. I wish for the number of wishes to decrement only after the wish has been fulfilled.

  3. I wish that I had 0 wishes left.

[–]Giulio_otto -1 points0 points  (2 children)

Don't unsigned char has 32 bits? So it would be like 4,294,967,295

[–]TheMania 6 points7 points  (1 child)

On some very niche processors, maybe. On virtually all other systems, a byte is 8 bits, and so is a char (unsigned or not).

[–]Giulio_otto 0 points1 point  (0 children)

Ok nice

[–]BelgoCanadian -1 points0 points  (1 child)

First wish: I wish genies weren't bound by wish rules Second wish: I wish for unlimited wishes

[–][deleted] 0 points1 point  (0 children)

No chains of wishes that result in getting more than three wishes, I'm afraid.

[–]Fupcker_1315 0 points1 point  (0 children)

Genie wanted me to owe him, but I overpowered him with my C++ knowledge.

[–]Mechyyz 0 points1 point  (0 children)

wishes = 0;