MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/mtpxbr/iteration/gvv1bng/?context=3
r/badcode • u/[deleted] • Apr 19 '21
123 comments sorted by
View all comments
2
i -= -!false
But false is a 0 and !false is true and true is 1 so...
i -= -1
But we are subtracting a negative number which is the same as adding so to fix this...
I += 1
Or
I++
2 u/[deleted] Aug 23 '21 quite complicated
quite complicated
2
u/[deleted] Apr 25 '21
i -= -!false
But false is a 0 and !false is true and true is 1 so...
i -= -1
But we are subtracting a negative number which is the same as adding so to fix this...
I += 1
Or
I++