On the Subject of Simon Swindles
Simon, if you're gonna cheat, at least cheat *well*...
On the module, there is a 3-pointed star with the colors Red, Green and Blue, as well as a button in the middle.
Your one goal: Beat Simon's cheating at mastermind.
When this module activates, it will generate two codes: The Answer and The Constant.
After every guess you make, Simon will change his answer based on The Output and your Input.
After a guess is made, Simon modifies a copy of the Constant to give to you as an output.
Firstly, he runs through your input like a set of commands that do the following things:
- BLACK: Reverse the string
- RED: Invert the red channel
- BLUE: Invert the blue channel
- GREEN: Invert the green channel
- CYAN: Cycle leftwards 1
- MAGENTA: Cycle rightwards 1
- YELLOW: Invert all channels
- WHITE: Reverse both halves of the string (STRING -> RTSGNI)
Then, after that, he XOR's* that string and your input.
Finally, he inverts any correct position.
The New Answer:
Oh, but he doesn't stop at obfuscating the correctivity of your guess, but he also changes the answer.
Firstly, he XOR's the Output and the Old Answer (the answer before this).
Then, he takes the N%6th positon of your input - where N is the number of inputs onto the module - and modifies the answer as such:
If the RED BIT is 1, reverse the first half. Otherwise, reverse the other half.
If the GREEN BIT is 1, invert the first half. Otherwise, invert the second half.
If the BLUE BIT is 1, cycle left 1. Otherwise, cycle right 1.