Yesterday I was blown away by both tetris and snake golfed out to this degree and now this. I feel like this is the modern reincarnation of obfuscated c.
Can somebody explain to me how: "a[i]+-~j" is the same as "a[i]+(j+1)" ?
Can somebody explain to me how: "a[i]+-~j" is the same as "a[i]+(j+1)" ?
-(~j) = Twos complement of the ones complement of j
Twos complement = ones complement + 1
So twos complement of (ones complement of j) = ones complement of (ones complement of j) + 1 = j + 1