A computer program that searches for control rod patterns has been developed. In the algorithm, the problem is decomposed into two levels. In the first level, according to an assumed average axial power distribution, a control rod pattern is determined that satisfies all constraints at each burnup step. In the second level, the conditions are checked at the end of the fuel cycle. If certain conditions are not satisfied, the average axial power distribution or the weighting factors are modified and the first-level search is repeated. The first-level search is formulated as an optimization problem with constraints. The constrained problem is converted to an equivalent unconstrained problem and a method similar to a penalty function method is then applied to obtain the control rod pattern. The program is demonstrated by successfully generating control rod programming for the Chinshan and Kuosheng nuclear power plants in Taiwan.