## On the Subject of Faulty Chinese Counting

It’s been well over a year, and I still don’t know if you buy your china in China.

This module contains four keys, each with a colored Chinese number on them, and two LEDs, each cycling 3 colors.

Using the color missing from left LED as the row and the one missing from the right LED as the column, consult the table below to get an order in which to press the keys.

White Red Green Orange A C H D H D A C C H D A H A C D
• A = Ascending in value
• D = Descending in value
• C = Ascending in number of characters of the actual value, descending in value in ties.
• H = Descending in number of characters of the actual value, ascending in value in ties.
 一 六 1 6 2 7 3 8 4 9 5 10

N.B.: Multiples of 10 are expressed using a number, and then 十 (For example, 20 is 二十). 100 is written as 一百, and 0 is written as 〇.

The actual values of the keys aren’t necessarily what’s displayed. Use each key’s color to determine its actual value.

• Black: Keep the value as is.
• Red: Value is 100 - the displayed value.
• Blue: Value is twice the displayed value.
• Green: Value is the displayed value plus the displayed value of the key diagonally opposite this one.
• Purple: Value is the average of all displayed values (round down).

Additionally, one of the following special cases will always apply:

• One key has no label: Consider the label to be the last digit of the serial number times the number of batteries, mod 100. Take the position of every other key’s color in the list above, average them (round down), and count that many into the list to find this key’s color.
• One key is cycling 3 different labels: Use the label displayed when the right LED shows the left LED’s missing color.
• One LED is missing: Take the number of ports times the number of battery holders, modulo 15, then convert this number to binary. If this LED is the left one, take the position of the leftmost 0. If it’s the right LED, take the position of the leftmost 1.* Use the row/column in this position from left to right or top to bottom respectively in the table above. If the bit needed isn’t present, use white.
• One key disappears when the module is selected: If this key is one of the 2 left keys, press the right LED to press this key. Otherwise, press the left LED to press this key.
• Module is upside down: Each key’s color is actually that of the key above/below it.

* N.B.: Note that the binary numbers are considered to be 4 digits long, but take the position of the first bit that was originally that bit. For example, 6 in binary is 110. Padded, that is 0110, and the first 0 that was in the original number is in position 4.