 ## On the Optimization of Alphabetical Ruling

I used to rule the world - Unfortunately I gave it too little care.

Original Manual

Use the letter to find the rule to modify the digit displayed. Afterwards, modulo this result by 10 by adding or subtracting 10 until it is within the range of 0-9. If after modulo 10, the value is 0, the actual value is 1. Press the button corresponding to that value. Do this 3 times to disarm.

### Case: Simple Modifiers, No Edgework

E F G Add 0. Modulo the digit by 6. Add 1. Add 1. If the digit is even, the value is 1. Otherwise the value is 5. Add 1.

### Case: Conditional Modifiers

L Q If there are exactly 4 batteries, 3 holders and 2 ports, add 0. Otherwise add 3. If the number of ports is more than 2, add the sum of 2 and the number of port plates. Otherwise add 0. If the sum of digits in the serial number is greater than 10 and the digit displayed is odd, the value is 5. Otherwise the value is 1. If there is at least 1 module with “Forget” in its name, add 2 times the number of batteries. Otherwise, multiply by 9.

### Case: J

J If the last digit of the serial number is 0 or 9, or Necronomicon is NOT present, add the number of PS/2 ports. Otherwise, find that digit on the top row of the table provided and add the corresponding value on the bottom row to that digit.
Last Serial No. Digit12345678