O'Reilly logo

Chris Crawford on Game Design by Chris Crawford

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Self-Modifying Game

Back in the good old days, we programming cowboys had a trick that's seldom used these days: self-modifying code. One segment of code re-wrote another segment of code. This was frowned upon because it made debugging particularly difficult. How could you tell where the problem was arising if you couldn't know which version of the code was actually executing?

Nevertheless, there were some situations in which self-modifying code was useful. One of these was anti-piracy. If self-modifying code was difficult for the programmer to debug, imagine how tough it would be on a pirate! I used that trick twice, and I still smile at the thought of some poor teenage geek running through code, trying to figure it out, and then encountering ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required