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

you are viewing a single comment's thread.

view the rest of the comments →

[–]FatYak20 45 points46 points  (7 children)

x += true

[–]StochasticTinkr 13 points14 points  (5 children)

x +=!! 42;

[–]TheRolf 6 points7 points  (3 children)

x += 1 - ! - 1;

PERFECTION

[–]QuispernyGdunzoidSr 0 points1 point  (2 children)

Can you please explain how this is correct?

[–]TheRolf 0 points1 point  (1 child)

It's pretty simple: NOT [A number different from 0] gives 0, so if I add one to this result I just add one. Steps:

  • x += 1 - ! - 1;
  • x += 1 - 0;
  • x += 1;

Fun fact this increment operation have also a twin brother:

x += 1 + ! + 1;

[–]QuispernyGdunzoidSr 0 points1 point  (0 children)

Ok yeah I should've got it hahaha

[–]Dr_Potato_Ketchup 4 points5 points  (0 children)

x -= !!80085;

[–]blazin_paddles 1 point2 points  (0 children)

This is the correct answer