Table Of Contents
Previous Section Next Section

Chapter 10: A Few Working Programs

Programmers love tricks. In this chapter, we take a look at some working programs that use extremely clever tricks to get the job done.

One interesting thing about these algorithms is that in the wild, they all existed totally without comments, thus giving all the programmers that followed a chance to puzzle them out for themselves. Now it's your turn.

Program 103: Quick Change

What's the quickest way to do the following:

       The variable i has the value 2 or 1. If i is 2 change it to 1. If i is 1 change
       it to 2.

(Next Hint 134. Answer 48.)

Table Of Contents
Previous Section Next Section