On the Subject of Mad Memory

Bonus points to any team who can disarm this without writing everything down.

The following table shows what the type and value of each display is.

Type
ABCD
Value1101ONEWON
2202TWOTOO
3303THREETREE
4404FOURFOR

Stage 1:

  • If the display is type A, select the button in the 3rd position.
  • Otherwise, if the display is type B, select the button in the 2nd position.
  • Otherwise, if the display is type C, select the button labeled “2”.
  • Otherwise, if the display is type D, select the button labeled “1”.
  • If the display has value 1, also select the button in the 4th position.
  • Otherwise, if the display has value 2, also select the button labeled “3”.
  • Otherwise, if the display has value 3, also select the button labeled “4”.
  • Otherwise, if the display has value 4, also select the button in the 1st position.

Stage 2:

  • If the display is exactly the same as in stage 1, select the buttons on the positions unselected in stage 1.
  • Otherwise, if the display has the same type as stage 1, select the buttons with the labels selected in stage 1.
  • Otherwise, if the display has the same value as stage 1, select the buttons whose labels are less than or equal to the number of characters on the display in stage 1.
  • Otherwise, select the button labeled “4” and the button whose position is the value of the text on the display.

Stage 3:

  • If the display is exactly the same as in stage 1 or 2, select the buttons with the labels unselected in stage 2.
  • Otherwise, if the display has the same type as stage 2, select the buttons with the labels unselected in stage 1.
  • Otherwise, if the display has the same value as stage 1, select the button whose label is the number of characters on the display in stage 2 (if such a button exists) and the button whose label is the value of the display.
  • Otherwise, select the buttons with previously unselected labels and the buttons in previously unselected positions.

Stage 4:

  • If the previous displays had three different values, select the buttons in the positions equal to those values.
  • Otherwise, if there’s exactly one unpressed label, select all buttons whose position is not equal to that unpressed label.
  • Otherwise, if the display has the same type as any earlier stage, select all buttons whose labels equal the values displayed in those stages.
  • Otherwise, if the display has the same value as any earlier stage, select the button whose position is the displayed value.
  • Otherwise, select the buttons in all the positions that have been selected less than three times.