The problem of computing optimal bang-bang controls for a nonlinear control system is discussed. It is shown that the method of replacing the optimal bang-bang control problem by a parameter optimization problem leads to an efficient algorithm. The problem of bringing a rotating rigid body to rest in minimum time is used to illustrate the theory. In this example, the parameter optimization problem reduces to a one-dimensional search.