In this case + wins at the seventh move.
The next step I made was to ascertain what number of combinations were required for all the possible variety of moves and situations. I found this to be comparatively insignificant.
I therefore easily sketched out mechanism by which such an automaton might be guided. Hitherto I had considered only the philosophical view of the subject, but a new idea now entered my head which seemed to offer some chance of enabling me to acquire the funds necessary to complete the Analytical Engine.
It occurred to me that if an automaton were made to play this game, it might be surrounded with such attractive circumstances that a very popular and profitable exhibition might be produced. I imagined that the machine might consist of the figures of two children playing against each other, accompanied by a lamb and a cock. That the child who won the game might clap his hands whilst the cock was crowing, after which, that the child who was beaten might cry and wring his hands whilst the lamb began bleating.
I then proceeded to sketch various mechanical means by which every action could be produced. These, when compared with those I had employed for the Analytical Engine, {469} were remarkably simple. A difficulty, however, arose of a novel kind. It will have been observed, in the explanation I gave of the Analytical Engine, that cases arose in which it became necessary, on the occurrence of certain conditions, that the machine itself should select one out of two or more distinct modes of calculation. The particular one to be adopted could only be known when those calculations on which the selection depended had been already made.
〈DIFFICULTY ARISING FROM CHOICE.〉
The new difficulty consisted in this, that when the automaton had to move, it might occur that there were two different moves, each equally conducive to his winning the game. In this case no reason existed within the machine to direct his choice: unless, also, some provision were made, the machine would attempt two contradictory motions.
The first remedy I devised for this defect was to make the machine keep a record of the number of games it had won from the commencement of its existence. Whenever two moves, which we may call A and B, were equally conducive to winning the game, the automaton was made to consult the record of the number of the games he had won. If that number happened to be even, he was directed to take the course A; if it were odd, he was to take the course B.
If there were three moves equally possible, the automaton was directed to divide the number of games he had won by three. In this case the numbers 0, 1, or 2 might be the remainder, and the machine was directed to take the course A, B, or C accordingly.