On the Subject of Rambunctiously Automating Rainbow Arrows

I will solve this module with the power of friendship and this gun I found!

See the original manual for instructions related to the module.

N Use the right digit of the display as the column, and the last digit of the serial number as the row.
0 1 2 3 4 5 6 7 8 9
0SE0S0SE0S0E0NE0NW0S0S0SW
1NE1NW1SW1E1NW1SE1N1S1W1W
2W2SE2NE2NW2S2N2W2NE2SE2S
3NW3NE3NE3NW3SW3W3W3SW3NE3S
4N4N4NW4NW4NW4SW4NW4S4N4SW
5S5NE5NW5SW5E5NE5S5NW5NE5E
6S6N6N6N6W6W6SW6E6N6E
7SW7NW7W7NE7W7S7W7SE7W7S
8S8NE8N8SW8E8W8SE8NW8SE8NE
9SE9N9N9N9W9W9S9NE9N9SW

NE Press the arrow that is n steps clockwise from white, where n is the column number of the range containing the display.
01234567
0-56-1617-2829-3940-5051-6162-7374-84
85-9596-99

If this is the 4th rule, press the opposite arrow (NE <> SW, etc.)

E

IF BATTERY HOLDERS >= PORT PLATES:

IndDisplay % (Batteries + 1) = 0Else
Par or SerElsePar or SerElse
DiagElseDiagElseDiagElseDiagElse
0NWWSWSSEENEN
1NWNWWWSWSWSS
2NWSENWSEWEWE
3NWSWSENENWSWSENE

ELSE:

IndDisplay % (Batteries + 1) = 0Else
Par or SerElsePar or SerElse
DiagElseDiagElseDiagElseDiagElse
0NWWSWSSEENEN
1SESEEENENENN
2SWNESWNESNSN
3WSENWSEN

Par or Ser: Is a parallel or serial port present on the bomb?

Diag: Has a diagonal arrow been pressed yet?

Ind: Number of total indicators

SE

If this arrow is white, press it.

Otherwise, starting from the last pressed arrow, go counter-clockwise until you reach an unpressed arrow.

Then, move clockwise a number of arrows equal to the number of arrows you’ve pressed, and press the arrow you end up on.

S

Assign each arrow to a letter from A-H, with the white arrow being A, and go clockwise from there. Create the string "ABCDEFGH" ("ABCDEFGH" if counter-clockwise) and modify it as follows:

  • Move any letters that are present in the serial number to the front, and put them in the order they first appear in the serial number.
  • If the last digit of the serial is even, move a number of characters from the end of the string, equal to the first digit of the serial, to the front of the string, maintaining their order. If the first digit is 9, use 1.
  • If there is an odd number of batteries, move the characters in odd numbered positions to the front of the string, maintaining their order.
  • If N or S are white, reverse the string.

Press the arrow that is assigned to the nth character in the string, where n is the digital root of the display, minus 1. If n is <1, use 1.

SW

Observe the below table. For each instance of a "[Module] Arrows" on the bomb, award the respective row one point. Compare each module name to the serial number, and award one point to the respective row for each letter in the name that appears in the serial number.

Press the arrow color in the row that scores the most points. If there is a tie, use the tied row closer to the top.

MODULELETTER DISTRIBUTIONCOLOR
REDDx1 Ex1 Rx1RED
ORANGEAx1 Ex1 Gx1 Nx1 Ox1 Rx1ORANGE
YELLOWEx1 Lx2 Ox1 Wx1 Yx1YELLOW
GREENEx2 Gx1 Nx1 Rx1GREEN
BLUEBx1 Ex1 Lx1 Ux1BLUE
INDIGODx1 Gx1 Ix2 Nx1 Ox1PURPLE
PURPLEEx1 Lx1 Px2 Rx1 Ux1PINK
DOUBLEBx1 Dx1 Ex1 Lx1 Ox1 Ux1WHITE

W

For each letter in the serial number, excluding duplicates, look it up in the below grid. Award one point to each cell which contains the letter. If any cells are tied for the most points, use the one that comes first in reading order. This is the winning cell.

Observe the winning cell in the grid. Modulo the display by 26, and add 1. Locate the cell adjacent to the winning cell which contains the smallest number that is greater than or equal to the calculated number. If all numbers are smaller than the calculated number, use the smallest number. The grid does not wrap around.

Press the arrow that matches the direction you would need to move to get from the winning cell to this new cell. (If you prefer the way the original manual does this, the starting letter is underlined for convenience.)

DEKOY

[25]

EHITW

[23]

EOPST

[16]

ISTXY

[24]

ELORW

[12]

AGNOT

[20]

ACGIM

[13]

JOSTU

[10]

ACEFR

[6]

AGLNO

[1]

IKQRU

[17]

EHLOT

[8]

EORSZ

[26]

ALORY

[18]

ABORV

[2]

ALTUV

[22]


NW

Compare the display to the serial number, if the serial number contains:

  • Both digits - N
  • Only the tens digit - W
  • Only the ones digit - E
  • Neither digit - S