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, initiallyTRUE
, -
A boolean variable (
TRUE
/FALSE
) called Prime, initiallyFALSE
,- 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.
-
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.
- ...equal to Last - subtract Last from Key, and set Trigger equal to
-
...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.
-
...even, and Key’s last digit is...: