This is definitely one of the best programs recently submitted to Creative Computing. It combines Bagels, Mastermind, Bulls and Cows, etc., into a general deductive logic game. But if you simply want to play Bagels, you set the inputs to N.3.9. One small (?) difference is that duplicate digits are permitted. For a really general-purpose game, you could put a modification in the digits selection routine (Statements 300-320) with a parameter that either allows or disallows duplicate digits. It does play Mastermind correctly without modification - set inputs to N.4.6. But the real fun is trying the new combinations like N.7.4. or N.5.5.
MasterBagels was written by H.R. Hamilton and published as type-in source code in Creative Computing, Vol. 3, No. 1, January/February 1977.