See extended (full-game-playing) version in example_12.29.
