Computox / AUTOX Move Selection

As has already been noted, the Computox uses the same move selection algorithm as the AUTOX.  It's worth looking at this in detail, as it makes up a big chunk of the logic in both machines.  In both cases move selection is driven by a uniselector or rotating relay.  

The primary uniselector, used for move selection

This is a device that connects one input to one of many outputs in turn.  Like a regular relay, the uniselector is activated by applying power to a coil.  This drives a ratchet mechanism moving an arm around a ring of contacts, advancing which output is connected to the input contact.  This ratchet process will continue whilst the power is applied to the coil.

The AUTOX and Computox use the connection of a particular output to test whether the state of the board matches one or more game positions, whether the required response to those positions is possible (i.e. the square isn't occupied by the player), and make the move if these criteria are met.  In the diagrams below, the uniselector common/input contact is U1-N0, with connecting it to each of the output contacts running from U1-N1 to U1-N25. Contact U1-N1 is not connected on the Computox.

For the moment, let's ignore how the rotation of the uniselector is started, stopped and reset.  We'll assume it's in a known state at the start of the machine's move.  It rotates until a move is made by the Computox, and then resets to the known state, ready for the next move.  This means we can focus on the tests made at each step and how moves are made.

The strategy the Computox employs comprises four tactics, in priority order these are:

  1. If possible, play a move to complete a line and win.
  2. If possible, play a move to block the human player completing a line to win.
  3. If possible, play a move to prevent the human player setting up a fork.
  4. Claim a "good", empty square, ignoring other aspects.

Let's look at each of these tactics in turn.

1 - Play a move to complete a line and win

The wisdom of this tactic is quite clear.  For example, if the Computox has already claimed squares E and J, and square A is free, it should claim square A, complete the diagonal and win.

For each of these possibilities it's necessary to check whether the Computox has already claimed two squares, and whether the human has not claimed the third.  This can be achieved with a circuit similar to the one below.

If the E and J squares are occupied, the EOA and JOA relays will be active.  This means that the EOA-T3 and JOA-T3 switches are closed.  If the A square is unoccupied, the AXA relay will be inactive and the AXA-T4 switch will also be closed.  At this point, because U1-N2 is connected to ground, current will flow through the AOA relay, activating it.  This will close AOA-T2, providing an alternate path to ground, keeping AOA active and permanently claiming the A square, until RESET is pressed.

It's possible to extend this idea as shown below.


Here, multiple checks are performed in parallel which could result in the Computox occupying either square A or B.  However, some care has to be taken that checks that result in multiple relays closing are executed sequentially.  This is achieved by connecting U1-N2 to a uniselector output, rather than directly to ground.  Then, as the uniselector advances, each set of tests can be applied in priority order, leading to the circuit below.

As the uniselector advances, U1-N2, U1-N3, U1-N4, etc. are connected to ground in turn, and the positions they are connected to tested.  In total, there are 24 single move wins that could be checked.  However, the AUTOX article states that the other tactics mean that this can be reduced to the 20 shown above.

2 - Block the player completing a line and winning

This is similar to tactic 1.  If the human player has claimed two squares of a winning line, the Computox should claim this final square to block the player.  For example, if X has claimed squares A and C, the machine should play B in order to prevent a loss on the next turn.  Like tactic 1, there are 24 potential winning moves to be blocked, which can be reduced to the 17 implemented in the circuit below.

The implementation of tactic 2 differs from tactic 1 in that switches *XA and *XB are tested instead of *OA and *OB.  This is because we're concerned with X having occupied a square rather than O.  Strictly, the check that X does not occupy the final square in the line is not really required, as if it did, the Computox would already have lost.  However, for consistency it is included.

4 - Claim a "good", empty square

We'll skip the implementation of tactic 3 for the moment, as the need for it is a consequence of tactic 4, which is just to choose a "good", empty square.  I think it's clear that some tic-tac-toe squares are more useful than others.  Specifically, the centre, E, is pretty handy.  If one of the three earlier tactics isn't employed, the Computox will play an unforced move, based on a priority order of squares.

When the human plays first, this order is E, A, J, CGB, HD (i.e. favour the centre, then corners and finally edges).  It's interesting that the machine only ever has to play F in a forced way.  When playing an unforced move, the only check that needs to be made is that the square is empty, leading to this circuit.

So far, so simple.  However, if the AUTOX or Computox plays first, the chances of winning are increased if the order is amended to AC, J, GB, H, D.  In this case, E is dropped as the starting move, and J and C are switched in the order.  This change in strategy can be incorporated as follows.


 

When the OS relay is active, the selection of E is prevented and the order of the assessment of C and J is reversed.  Once asserted by OS-INP going low, the state of the OS relay is latched by its OS-T1 switch until RESET is pressed.

3 - Play a move to prevent the human player setting up a fork

OK, armed with these three tactics let's go back and look at a game, with the machine starting.

  1. The first move is unconstrained, and the machine uses tactic 4 to play O to square A.
  2. The human plays X to square F.
  3. The machine remains unconstrained and plays C, consistent with tactic 4.
  4. The human is now forced to play B.
  5. The machine still doesn't have a forced move, and plays J according to tactic 4.
  6. At this point the human is forced to play E, setting up a fork on D and H.
  7. The machine plays D blocking the first winning move, consistent with tactic 2.
  8. The human plays H and wins.

This problem is caused by the machine playing J on move 5.  In the event that the human plays F and B, the fork can be prevented by playing E instead.  At this point, the Computox has set up a fork of its own, ensuring victory on the next move using tactic 1.  The AUTOX article suggest there are six dangerous positions that must be guarded against, before allowing the machine to choose a square using tactic 4.  These checks can be implemented using the following circuit.


 

At this point, in its default configuration the machine will play perfectly, winning or drawing, but never losing.  As such, it's a potentially frustrating opponent.  By including the X-T2 and X-B1 switches in tactic 3, five of the six fork checks can be disabled.  This allows the player to set up a fork and defeat the Computox if the X relay is active.  Like the OS relay, once X-INP goes low, activating relay X, its state is latched by X-T1 until RESET is set.

Implementation details

The schematics and explanations shown thus far are based on the AUTOX circuits and descriptions in Model Engineer, backed up by confirming the wiring on the Computox.  However, in a couple of areas the Computox implementation differs from that printed.

*OB and *XB relays

In the schematics you will observe that switches on the *OB and *XB relays are used to test positions. However, only the *OA and *XA relays are shown to be activated when selecting a square.  The need for *OB and *XB relays comes about because type 3000 relays can support a maximum of eight switches, a point noted in the text of the AUTOX articles, but not in their circuits.

The article suggests that this constraint can be circumvented using two relays, with their coils connected in parallel.  However, the Computox does not use this approach.  Instead it uses a switch on *OA or *XA (typically the B2 switch, with the exception of BXA which uses T1) to activate the coil on *OB or *XB respectively, as shown below.

When EOA activates, EOA-B2 closes, providing a path to ground through the EOB coil.  The reason for choosing this approach, which will introduce a propagation delay in activating *OB and *XB, is not known.

EOA and FOA wiring

As I mentioned, whilst the Computox is pretty consistent in its wiring, there are some exceptions (e.g. the use of T1 on BXA to power the BXB relay coil).  The wiring of EOA and FOA is another example of this.  Looking at the EOA and FOA coils it is clear that a silicon diode has been added to one terminal, as shown below.


These are the only coils that have these diodes.  It's not clear when this was done or why, especially as the orientation of the diodes would seem to preclude the coils working (assuming the polarity of the supply rails is correct).  What's more, EOA-T2 and FOA-T2 don't seem to be set up to latch the EOA and FOA relays.  At this point, it's not known how these relays are latched.  For the moment it is assumed that these differences are some kind of workaround for a fault, and the canonical approach found in the AUTOX articles could have been used.

Conclusions

The move selection algorithm is a significant part of the Computox, requiring 90 switches, about a third of the total.  Having fleshed out the Computox implementation we are well on the way to understanding how the machine works. 

Comments