A program that crippled itself.
Not sure if this could be called “cool,” but interesting, yes.
This was in the pre-Windows 95 days. My program would read its own binary image and make changes to certain bits, so that the next time it ran, the constant value that was checked on start up would be lower, and once it had reached zero, it simply refused to run. Of course, I would have to re-compile from source to make it run again. Back then it was fun knowing that my program could modify itself.
Other than this, I also wrote C programs that inverted the entire screen, and so on and so forth.
Those were heady days, when I wrote code for the fun of it rather than for money.
Original post:
Image courtesy: By Matthew (WMF) - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=17589502