On the Subject of Distance Cipher
Two metres please.
On the module, there will be two parallelogram-shaped displays, three triangular buttons arranged in a triforce formation, and another triangular button to the right of them, showing the key letter and the key digit.
To disarm this module, perform the following steps to obtain a triangular key grid, then use it to obtain your decrypted word to submit into the module using the buttons arranged in a triforce formation.
Step 0: Making the key triangle
Create a 7×7 equilateral triangle, with one of its vertices facing South. Place the first letter of the keyword in the first cell in reading order of this triangle. Then, for each subsequent letter in the keyword, if it has been used, find the closest unused letter (with wraparound, so the distance between the letters A and Z is the same as A and B, that being 1), and place it in the next unfilled cell of the triangle. Repeat this until all letters of the keyword have been used, and the top-most row of the triangle has been filled.
Then, for each subsequent cell, consider the absolute difference between the two alphabetical positions of the two cells immediately above. If the corresponding letter has not been used, place it in the next unfilled cell. Otherwise, follow the same procedure for when a used letter is encountered. Then, place the unused letter in the next unfilled cell. Repeat this until 25 out of the 26 letters in the English alphabet have been used. The remaining letter will be referred to as the “unused letter”. Place #'s in the cells in the second to last row, then the unused letter at the bottom.
If a previously used letter is encountered and the two nearest unused letters have the same distance to the used letter, take the unused letter that would be reached by going backwards in the alphabet, wrapping from A to Z.
Example triangular grid using the keyword “FOREVER”
F O R E V D Q
I C M P S L
G J B A H
Z K Y N
T U W
# #
X