The program was from the graphics chapter(s) and was a visual demonstration of the Tortoise and the Hare fable using Atari graphics (Graphics 5, if I remember correctly). Two rectangular areas were drawn on screen. The Tortoise filled its area pixel by pixel, systematically. The Hare filled its area by plotting lines between two randomly chosen points inside its rectangle — which covered a lot of pixels quickly but, due to the random approach, always finished last.
In case it helps identify the book: another program from the same graphics section drew a detailed picture of the Atari computer itself — keyboard, cartridge slot, and all — using Graphics 8.
Does anyone remember this, or know which book it came from?
Page 47 for Tortoise and the Hare, page 245 for the Atari drawing.