On the Subject of Levenshtein Distance
Close is further than far if you travel by car.
- Two words of length 4–8 will be displayed on the top two displays.
- There are ten buttons with digits that you can use to type in your answer, which will then be displayed on the bottom display. This number cannot have more than two digits.
- There are also three other buttons with the labels “SUB” (used to submit your answer), “CLR” (used to clear the bottom display) and “DEL” (usde to delete the last digit displayed on the bottom display, if there are any).
- Pressing any other button than “SUB” will never issue a strike.
- Pressing the button with the label “SUB” will solve the module if the number displayed on the bottom display is the correct answer.
- The module will always strike if you press the button with the label “SUB” if there is nothing displayed on the bottom display, and if the module has not yet been solved.
- The module does not reset after striking, the correct answer never changes.
- To calculate the correct answer, follow the steps below.
- First, calculate the Levenshtein Distance of the words displayed on the top two displays. Refer to Appendix Levenshtein Distance for instructions. Call the result LD.
- Multiply LD by the number of batteries present on the bomb if there is at least one. Otherwise, multiply LD by 1. You now have X.
- Multiply the number of port types with the number of indicators present on the bomb. Add this product to X to get Y.
- If any digit in the sum of the serial number digits appears in the serial number itself, subtract 1 from Y to get Z.
- The correct answer is Y modulo 100.
- Modulo by 100 is done by repeatedly adding or subtracting 100 until the number is in the range of 0 to 99 inclusively.
- You can keep Z for good luck. It is not needed to solve the module.
- However, if the serial number contains the letters L and D, submit the raw LD value. You are spared of all the modifications.