On the Subject of Not Red Arrows

What kinda module is this?! I’m not a human pseudo-code interpreter!!!

On the screen is your Starting Number.

The Up and Down buttons will change the number by 1, while the Left and Right will change the number by 10.

Throughout the entire manual, keep track of:

  • A numerical variable called Key, initially equal to your Starting Number,
  • A numerical variable called Counter, initially equal to 0,
  • A numerical variable called Tick, initially equal to 0,
  • A numerical variable called Fin-Len, initially equal to 0,
  • A numerical constant called Last, equal to the last digit of the bomb’s serial number,
  • A boolean variable (TRUE/FALSE) called Trigger, initially TRUE,
  • A boolean variable (TRUE/FALSE) called Prime, initially FALSE,
    • and you may need to introduce new variables throughout the manual.

Note the following:

  • Constants are set once and are never changed again, while variables may be modified throughout the steps.
  • Binary Length of a number is the length of the number’s binary representation (i.e. number of bits), excluding any leading zeros.
    • The Binary Length of 0 is 0.
  • Some edge cases with negative numbers:
    • Negative numbers are interpreted as positive when calculating their Binary Lengths and counting “1”s in their binary representations.
    • If a number N is negative, (N mod 10) is actually equal to -((-N) % 10). (e.g. -12 % 10 = -2)
    • If a number P is prime, then number -P is also considered prime.

Follow the numbered steps below, starting from 1, in ascending order, going straight to certain numbered steps when told.


  1. If Key is...:
    • ...even, and Key’s last digit is...:
      • ...equal to Last - subtract Last from Key, and set Trigger equal to FALSE.
      • ...greater than Last - set Key equal to ((Last + 2) * 7).
      • ...less than Last - add Last to Key.
    • ...odd, and Key’s last digit is...:
      • ...equal to Last - multiply Key by 2, then take it modulo 100.
      • ...greater than Last - set Key equal to ((Last - 2) * 5), and set Trigger equal to FALSE.
      • ...less than Last - subtract Key from 50 and set it equal to the result.
  1. Add the number of “1”s in Key’s binary representation to Counter
  2. If Tick is equal to 3 - set Fin-Len equal to the Binary Length of Key, then go to step numbered 6.
  3. If the Binary Length of Key is...
    • ...even, and Trigger is TRUE - multiply Key by (Binary Length of Key + 1), and set Trigger equal to FALSE.
    • ...even, and Trigger is FALSE - add (Binary Length of Key) to Key.
    • ...odd, and Trigger is TRUE - add (Binary Length of Key * Last) to Key.
    • ...odd, and Trigger is FALSE - add 1 to Key.
  4. Add 1 to Tick, then go back to step numbered 2.
  5. Introduce a new numerical variable called ATR, initially equal to 0.
  6. If Trigger is...
    • ...TRUE - set ATR equal to (Fin-Len * Last + 3), and then add 1 to Key.
    • ...FALSE - set ATR equal to (Counter - Last + 4), and then subtract 10 from Key.
  7. Introduce a new numerical constant called X, equal to (32 - Counter).
  8. Introduce a new numerical variable called i, initially equal to 0.
  9. If the Starting Number is less than ATR - add ((ATR + 1) * X) to Key, then immediately go to step numbered 15.
  10. If i is equal to X - go to step numbered 15
  11. If the Starting Number is a multiple of (ATR + i) - add ((ATR + i) * (X - i)) to Key, then go to step numbered 15.
  12. Add (ATR + 1) to Key.
  13. Add 1 to i, then go back to step numbered 11.
  14. If Key is now a prime number - set Prime equal to TRUE.
  15. Introduce two new numerical variables called B and V, both initially equal to 0.
  16. If Prime is...
    • ...TRUE - set B equal to 2, and set V equal to (Counter mod (Last + 1) + 2).
    • ...FALSE - set B equal to 1, and set V equal to (X mod (Last + 1) + 5).
  17. Set i equal to 0.
  1. If i is equal to V - go to step numbered 23.
  2. Add i to B.
  3. If Prime is...
    • ...TRUE, add (X mod B) to Key.
    • ...FALSE, add (Counter mod B) to Key.
  4. Add 1 to i, then go back to step numbered 19.
  5. Introduce one last numerical variable called Answer, initially equal to 0.
  6. If Trigger and Prime are repsectively...
    • TRUE and TRUE, and Key’s last digit is...:
      • ...equal to Last - set Answer equal to (Key - Counter + 11).
      • ...greater than Last - set Answer equal to (Key + 2).
      • ...less than Last - set Answer equal to (Key + 11).
    • TRUE and FALSE, and Key’s last digit is...:
      • ...equal to Last - set Answer equal to (11 * (Key - Counter)).
      • ...greater than Last - set Answer equal to (2 * Key - Fin-Len).
      • ...less than Last - set Answer equal to Key.
    • FALSE and TRUE, and Key’s last digit is...:
      • ...equal to Last - set Answer equal to (Counter + 11).
      • ...greater than Last - set Answer equal to (Key - 21).
      • ...less than Last - set Answer equal to (Last * 11).
    • FALSE and FALSE, and Key’s last digit is...:
      • ...equal to Last - set Answer equal to (Key - 11).
      • ...greater than Last - set Answer equal to (X + Last).
      • ...less than Last - set Answer equal to (Counter + 11).
  7. Set Answer equal to its absolute value (i.e. if it is negative, multiply it by -1).
  8. Take Answer modulo 100 - Answer is now the number you should submit into the module.