Obfuscated Game of Life in 9 lines of C
github.com
github.com
echo 'int main(){int _[2048],O=(int)&O,__=~__+__;while((__=-~__)^2048)__[_]=(O=(O*0x41C64E6D+12345)&0x7fffffff)&1024?1<<5:0;while(usleep('"'"'d'"'"'<<'"'"'\n'"'"'),__+=~__){while((__=-~__)^8192){if(_[((__>>2)+2048+"\x01?@A"[__%4])%04000]&1<<5)*(_+(__>>2))=-~_[__>>2];if(_[((__>>2)+04000-"\x01?@A"[__%4])%2048]&1<<5)*(_+(__>>2))=-~_[__>>2];if(__%4==3)_[__>>2]|=_[__>>2]^'"'"'\"'"'"'&&_[__>>2]^'"'"'#'"'"'?((_[__>>2]^3)?0:1<<4):1<<4;};while((__=-~__)^10240)if(putchar((_[__%2048]=_[__%2048]<<1&1<<5)?'"'"'X'"'"':'"'"' '"'"'),!(63^__%0100))putchar(10);}};' | gcc -xc - && ./a.out
.https://github.com/duckythescientist/obfuscatedLife/blob/mas...
Code is obfuscated more than needed to run. It starts with something simple like this:
"I abuse 2's complement math to initialize it as -1"
Instead of: __ = -1 The code reads: __=~__+__
... and then gets more and more bizarre.
then it's ~__+__
so
0x00101101
+0x11010010
You can see how that always works.if you could produce a piece of code that exhibits the behaviour you describe, i'd very much like to see it.
Unless you have something else writing to this address, the value will not change. Since the program's stack is only available to that program, it will stay the same.
http://blog.llvm.org/2011/05/what-every-c-programmer-should-...
Care to quote the sentence(s) that say differently?
To see it:
`git clone https://github.com/duckythescientist/obfuscatedLife.git
cd obfuscatedLife
gcc life.c
./a.out`
Here is a screenshot[1] for anyone who didn't run the code. However a screenshot hardly does the dynamic nature of it justice.
http://www.youtube.com/watch?v=LFx46bAq-_E
As well, for those that don't want to use youtube, you can view/stream the raw video here:
http://lelandbatey.com/files/Obfuscated%20C%20-%20Game%20Of%...
https://github.com/stefanpenner/obfcuscatedLife.rb/blob/mast...
and for those crazy people who ever far to trusting:
curl https://raw.github.com/stefanpenner/obfcuscatedLife.rb/master/game_of_life.rb | rubyYes, that's a snark, but also a challenge to those with time on their hands. Bonus points if your solution grows the universe to contain, e.g., an escaping glider.
> also a challenge
Is CSS turing-complete? If not, game over.
Edit: Apparently, it has indeed been removed from SUSv4.