Mastermind

Description
The Mastermind node provides a streamlined way to implement the classic "code-breaker" logic within an escape room. It compares a series of player-provided inputs (value1 through value9) against a target sequence. Upon triggering the check action, the node calculates how many values are exactly correct in both type and position, as well as providing feedback for individual inputs. This is perfect for puzzles involving keypad codes, color sequences, or physical object placement where players need partial feedback to proceed.
Use Cases
* Classic Code Breaking: Create a puzzle where players must find a 4-digit code. The node can trigger a "yellow light" for correct numbers in the wrong spot and a "green light" for correct numbers in the correct spot.
* Symbol Alignment: Use variant inputs to represent different symbols or objects. As players rearrange them, this node tracks which specific positions are currently correct via the ok boolean outputs.
* Multi-Stage Validation: Use the onCorrect action to unlock a maglock and the onError action to trigger a "wrong answer" sound effect or a penalty timer.
Connectors in
- sequence [type: string]: The target solution or pattern players are trying to match.
- check [type: action]: The execution pulse that triggers the comparison logic.
- value1 – value9 [type: variant]: The current player inputs to be checked against the solution sequence.
Connectors out
- correct [type: bool]: High/True if the entire input set perfectly matches the sequence.
- correct total [type: integer]: The total count of values that exist in the solution, regardless of position.
- correct position [type: integer]: The number of values that are both correct and in the right position.
- correct values [type: string]: A string representation of the correctly identified values.
- ok1 – ok9 [type: bool]: Individual status indicators for each input; True if that specific value is correct and in the correct position.
- onCorrect [type: action]: Fired when the entire sequence is successfully matched.
- onError [type: action]: Fired if the
checkaction is triggered but the input does not match the solution.
Node properties
- sequence [type: string]: The default solution string (can be overridden by the
sequenceinput connector). - wait for event [type: bool]: If enabled, the node will only evaluate the logic when the
checkaction is received, rather than updating in real-time.
Connectors in
- sequence [type: string]
- check [type: action]
- value1 [type: variant]
- value2 [type: variant]
- value3 [type: variant]
- value4 [type: variant]
- value5 [type: variant]
- value6 [type: variant]
- value7 [type: variant]
- value8 [type: variant]
- value9 [type: variant]
Connectors out
- correct [type: bool]
- correct total [type: integer]
- correct position [type: integer]
- correct values [type: string]
- ok1 [type: bool]
- ok2 [type: bool]
- ok3 [type: bool]
- ok4 [type: bool]
- ok5 [type: bool]
- ok6 [type: bool]
- ok7 [type: bool]
- ok8 [type: bool]
- ok9 [type: bool]
- onCorrect [type: action]
- onError [type: action]
Node properties
- sequence [type: string]
- wait for event [type: bool]