- Learn
- Tutorials
- Algorithms
- Binary Search
- Appendices
- A Logic Reference
Appendix A — Logic Reference
Every Logic Component and Function in Crack the Safe, as it is in the finished game. Each entry stands on its own: read what it does, see what it needs, and build it from its card into your own game. A card’s Shared Variables and Per Instance Variables are the values you can change. A Shared Variable holds one value for the whole Object, under Variables in its Properties. A Per Instance Variable holds one for each placement in the Scene.
A.2 Clear Entry (Function)
Built in Chapter 1, Safe Room.
Empties the entry (Clear) while the keypad is open, so the next digit typed is its first digit.
safeStateData StructureSafe State- Action Name
keypad- safeRules
safeRules
keypad.value == true- Variable
$entry- Value
0
- Component Value
safeRules.safeState.startsNewEntry- Value
false
- Variable
$message- Value
data('Safe Copy','Code Sealed','text')
A.3 Erase Digit (Function)
Built in Chapter 1, Safe Room.
Removes the last digit of the entry (Back) while the keypad is open. The next digit typed is added to what is left.
safeStateData StructureSafe State- Action Name
keypad- safeRules
safeRules
keypad.value == true- Variable
$entry- Value
floor($entry / 10)
- Component Value
safeRules.safeState.startsNewEntry- Value
false
- Variable
$message- Value
data('Safe Copy','Code Sealed','text')
A.4 Keypad Keys
Built in Chapter 1, Safe Room.
Lets the keyboard work the keypad: the digit keys type a digit, Backspace erases the last digit, and Delete clears the entry. The keypad's buttons call the same Functions. What Enter does depends on the role, so Human Role and Computer Role answer it.
Any Objectself.safeState- safeRules
self- digit
0
- safeRules
self- digit
1
- safeRules
self- digit
2
- safeRules
self- digit
3
- safeRules
self- digit
4
- safeRules
self- digit
5
- safeRules
self- digit
6
- safeRules
self- digit
7
- safeRules
self- digit
8
- safeRules
self- digit
9
- safeRules
self
- safeRules
self
A.5 New Safe
Built in Chapter 1, Safe Room.
Starts the first safe when the game begins, in the Human role.
Any Objectself.safeState- safeRules
self
A.7 Show Entry
Built in Chapter 1, Safe Room.
Keeps the keypad display up to date: the number of the entry, or dashes while the entry is empty (0).
Any Object- entryText
@self.entryText- emptyText
@self.emptyText
- entryText
@self.entryText- emptyText
@self.emptyText
A.8 Show Entry Or Dashes (Function)
Built in Chapter 1, Safe Room.
Shows the entry text while the entry has a number, and the dashes while it is empty (0).
$entry > 0- Applies to
entryText- Visible
true
- Applies to
emptyText- Visible
false
- Applies to
entryText- Visible
false
- Applies to
emptyText- Visible
true
A.9 Type Digit (Function)
Built in Chapter 1, Safe Room.
Adds one typed digit to the entry while the keypad is open. The first digit after a finished entry starts a new entry; later digits are added on the right while the entry is below the highest code.
safeStateData StructureSafe State- Action Name
keypad- safeRules
safeRules
keypad.value == truesafeRules.safeState.startsNewEntry == true- Variable
$entry- Value
0
- Component Value
safeRules.safeState.startsNewEntry- Value
false
$entry < data('Safe Settings','Standard Safe','highestCode')- Variable
$entry- Operator
*=- Value
10
- Variable
$entry- Operator
+=- Value
digit
- Variable
$message- Value
data('Safe Copy','Code Sealed','text')
A.10 Type Its Digit
Built in Chapter 1, Safe Room.
A keypad button that types its digit when the player clicks it, the same as pressing its digit key on the keyboard. Like the key, it does nothing while the game's controls are off (the Myth Lesson is open).
Any Object- Action Name
controlsOn- Input Context
Game Controls
controlsOn.value == true- safeRules
@self.safeRules- digit
self.digit
A.11 Check Guess (Function)
Built in Chapter 2, Human Scan.
Compares a guess with the code and answers with the clue: 1 when the code is higher than the guess, -1 when it is lower, 0 when the guess is the code.
- Name
clue- Value
0
guess == code- Variable
clue- Value
0
guess < code- Variable
clue- Value
1
- Variable
clue- Value
-1
- Value
clue
A.12 Follow the Clue (Function)
Built in Chapter 2, Human Scan.
Uses the clue of the scan just made: Unlocked when the guess is the code; otherwise the range shrinks past the guess, and the trial is Exhausted when the scan budget is spent.
safeStateData StructureSafe StatesafeRules.safeState.clue == 0- Variable
$low- Value
$lastGuess
- Variable
$high- Value
$lastGuess
- Applies to
safeRules- Game State
Unlocked
- Variable
$message- Value
data('Safe Copy','Unlocked','text')
safeRules.safeState.clue == 1- Variable
$low- Value
$lastGuess + 1
- Variable
$message- Value
text(data('Safe Copy','Higher Than','text'), ' ', $lastGuess)
- Variable
$high- Value
$lastGuess - 1
- Variable
$message- Value
text(data('Safe Copy','Lower Than','text'), ' ', $lastGuess)
$scans >= data('Safe Settings','Standard Safe','scanBudget')- Applies to
safeRules- Game State
Exhausted
- Variable
$message- Value
data('Safe Copy','Out of Scans','text')
A.13 Scan Guess (Function)
Built in Chapter 2, Human Scan.
Tries the entry as a guess. A guess counts only while the safe is Locked and only inside the range of codes still possible; it then counts one scan, asks Check Guess for the clue, and follows it.
safeStateData StructureSafe State- Action Name
safeIsLocked- Applies to
safeRules- Game State
Locked
safeIsLocked.value == true$entry >= $low && $entry <= $high- Variable
$lastGuess- Value
$entry
- Variable
$scans- Operator
+=- Value
1
- Component Value
safeRules.safeState.startsNewEntry- Value
true
- Action Name
checkedGuess- guess
$lastGuess- code
safeRules.safeState.code
- Component Value
safeRules.safeState.clue- Value
checkedGuess.value
- safeRules
safeRules
- safeRules
safeRules
- Variable
$message- Value
data('Safe Copy','Outside the Range','text')
- Variable
$message- Value
data('Safe Copy','Start a New Safe','text')
A.14 Show Possibilities
Built in Chapter 2, Human Scan.
Keeps the words after the count of codes still possible right, from the start and whenever the range changes.
Any Objectself.possibilitiesLine- line
self
- line
self
A.15 Show Safe Door
Built in Chapter 2, Human Scan.
Shows the safe open while the trial is Unlocked, and closed in every other phase.
Any Object- Action Name
safeIsOpen- Game State
Unlocked
safeIsOpen.value == true- Sprite
Unlocked Safe
- Sprite
Locked Safe
A.16 Start New Safe (Function)
Built in Chapter 2, Human Scan.
Starts a fresh trial on a new safe in the Human role: draws a new secret code with the engine's random block and resets the trial.
safeStateData StructureSafe State- Action Name
codeRoll- Minimum
data('Safe Settings','Standard Safe','lowestCode')- Maximum
data('Safe Settings','Standard Safe','highestCode')
- Component Value
safeRules.safeState.code- Value
codeRoll.value
- safeRules
safeRules
- Applies to
safeRules- Game State
Locked
- Variable
$message- Value
data('Safe Copy','Scan a Guess','text')
A.17 Write Possibilities Line (Function)
Built in Chapter 2, Human Scan.
Writes the words after the count of codes still possible: possibility remains when only one code is left, possibilities remain otherwise.
possibilitiesLineData StructurePossibilities Line$low == $high- Component Value
line.possibilitiesLine.words- Value
data('Safe Copy','One Possibility Remains','text')
- Component Value
line.possibilitiesLine.words- Value
data('Safe Copy','Possibilities Remain','text')
A.18 Clue Word (Function)
Built in Chapter 3, Scan Record.
Answers with the words a Scan Card shows for a clue: UNLOCKED for 0, HIGHER for 1, LOWER for -1.
- Type
Text- Name
word
clue == 0- Variable
word- Value
data('Safe Copy','Card Unlocked','text')
clue == 1- Variable
word- Value
data('Safe Copy','Card Higher','text')
- Variable
word- Value
data('Safe Copy','Card Lower','text')
- Value
word
A.19 Lay Out Scan Record
Built in Chapter 3, Scan Record.
Makes the record strip when the Safe Room begins: one Code Mark for each code a safe can have, and one Scan Card, with its guess and its clue, for each scan of the budget. The strip and the row of cards keep their width and share it out in equal slots, so the record fits the window whatever the range of codes and the scan budget.
Any Objectself.layOutScanRecordData- Label
"Code Marks"- Color
#48BAB5
- Component Value
self.layOutScanRecordData.codeCount- Value
data('Safe Settings','Standard Safe','highestCode') - data('Safe Settings','Standard Safe','lowestCode') + 1
- Component Value
self.layOutScanRecordData.markSlot- Value
@self.stripWidth / self.layOutScanRecordData.codeCount
self.layOutScanRecordData.codeCounttimes- Object to Create
@self.codeMark- X
0- Y
0- Created As
mark
- Applies to
mark- Position Relative To
Screen- X
@self.stripLeft + (local.index + 0.5) * self.layOutScanRecordData.markSlot- Y
@self.markTop
- Variable
mark.code- Value
data('Safe Settings','Standard Safe','lowestCode') + local.index
- Label
"Scan Cards"- Color
#F3C569
- Component Value
self.layOutScanRecordData.cardSlot- Value
@self.rowWidth / data('Safe Settings','Standard Safe','scanBudget')
- Component Value
self.layOutScanRecordData.cardScale- Value
min(1, self.layOutScanRecordData.cardSlot / @self.cardRoom)
data('Safe Settings','Standard Safe','scanBudget')times- Object to Create
@self.scanCard- X
0- Y
0- Created As
card
- Applies to
card- Position Relative To
Screen- X
@self.rowLeft + (local.index + 0.5) * self.layOutScanRecordData.cardSlot- Y
@self.cardTop
- Applies to
card- Horizontal Scale
self.layOutScanRecordData.cardScale- Vertical Scale
self.layOutScanRecordData.cardScale
- Variable
card.scan- Value
local.index + 1
- Object to Create
@self.cardGuess- X
0- Y
0- Created As
guess
- Applies to
guess- Position Relative To
Screen- X
@self.rowLeft + (local.index + 0.5) * self.layOutScanRecordData.cardSlot- Y
@self.guessTop
- Applies to
guess- Horizontal Scale
self.layOutScanRecordData.cardScale- Vertical Scale
self.layOutScanRecordData.cardScale
- Variable
guess.scan- Value
local.index + 1
- Object to Create
@self.cardClue- X
0- Y
0- Created As
clue
- Applies to
clue- Position Relative To
Screen- X
@self.rowLeft + (local.index + 0.5) * self.layOutScanRecordData.cardSlot- Y
@self.clueTop
- Applies to
clue- Horizontal Scale
self.layOutScanRecordData.cardScale- Vertical Scale
self.layOutScanRecordData.cardScale
- Variable
clue.scan- Value
local.index + 1
A.20 Record Scan (Function)
Built in Chapter 3, Scan Record.
Adds the scan just made to the Scan Log as row "Scan N" (N is the scan's number): its guess, its clue, and the range after the clue narrowed it.
safeStateData StructureSafe State- Action Name
addedRow- Table
Scan Log- Row
text('Scan ', $scans)- Values > guess
$lastGuess- Values > clue
safeRules.safeState.clue- Values > low
$low- Values > high
$high
A.21 Show Code Mark
Built in Chapter 3, Scan Record.
Colors one Code Mark by what the player knows about its code: gold for the last guess, teal while the code is still possible, dark once it is ruled out.
Any Objectself.markFaceself.markFace.code == $lastGuess- Value
@self.lastGuessColor
self.markFace.code >= $low && self.markFace.code <= $high- Value
@self.inRangeColor
- Value
@self.ruledOutColor
A.22 Show Scan Card
Built in Chapter 3, Scan Record.
Shows one piece of a Scan Card (the card, its guess or its clue) once the card's scan has happened, with that scan's guess and clue from the Scan Log, and hides it again when a new safe starts.
Any Objectself.cardFace- Visible
No
self.cardFace.scan <= $scans- Component Value
self.cardFace.guess- Value
data('Scan Log', text('Scan ', self.cardFace.scan), 'guess')
- Action Name
cardWords- clue
data('Scan Log', text('Scan ', self.cardFace.scan), 'clue')
- Component Value
self.cardFace.clue- Value
cardWords.value
- Visible
Yes
- Visible
No
A.23 Check Keypad Open (Function)
Built in Chapter 4, Computer Search.
Answers whether the player may type on the keypad now: while setting a code for the computer (Setup), or while the human cracks a Locked safe.
safeStateData StructureSafe State- Type
Boolean- Name
isOpen- Value
false
- Variable
isOpen- Value
false
- Action Name
settingCode- Applies to
safeRules- Game State
Setup
settingCode.value == true- Variable
isOpen- Value
true
- Action Name
safeIsLocked- Applies to
safeRules- Game State
Locked
- Action Name
humanCracks- Applies to
safeRules- Logic Component
Human Role
safeIsLocked.value == true && humanCracks.value == true- Variable
isOpen- Value
true
- Value
isOpen
A.24 Choose Computer Role (Function)
Built in Chapter 4, Computer Search.
Hands the safe to the computer if the human has it: turns the Human Role Logic off and the Computer Role Logic on, starts Setup for a new code, and sends roleChosen. If the computer already has it, nothing changes.
safeStateData StructureSafe State- Action Name
humanCracks- Applies to
safeRules- Logic Component
Human Role
humanCracks.value == true- Applies to
safeRules- Logic Component
Human Role- State
Disable
- Applies to
safeRules- Logic Component
Computer Role
- safeRules
safeRules
- Custom Event
roleChosen
A.25 Choose Human Role (Function)
Built in Chapter 4, Computer Search.
Hands the safe to the human if the computer has it: turns the Computer Role Logic off and the Human Role Logic on, starts a new safe, and sends roleChosen. If the human already has it, nothing changes.
safeStateData StructureSafe State- Action Name
computerCracks- Applies to
safeRules- Logic Component
Computer Role
computerCracks.value == true- Applies to
safeRules- Logic Component
Computer Role- State
Disable
- Applies to
safeRules- Logic Component
Human Role
- safeRules
safeRules
- Custom Event
roleChosen
A.26 Choose Midpoint (Function)
Built in Chapter 4, Computer Search.
Answers the computer's next guess for a range of codes: the middle of low and high, rounded down. It is given only the two ends of the range, never the code.
- Name
midpoint- Value
0
- Variable
midpoint- Value
floor((low + high) / 2)
- Value
midpoint
A.27 Choose Role
Built in Chapter 4, Computer Search.
Lets the keyboard choose the role: H for the Human role, C for the Computer role. The role tabs call the same Functions.
Any Objectself.safeState- safeRules
self
- safeRules
self
A.28 Computer Role
Built in Chapter 4, Computer Search.
What the controls do while the computer cracks the safe: Enter locks the code, Space takes one Step, A runs or pauses the search, and R goes back to Setup for a new code. Choose Computer Role and Watch Computer turn this Logic on.
Any Objectself.safeState- safeRules
self
- safeRules
self
- safeRules
self
- safeRules
self
A.29 Current Situation (Function)
Built in Chapter 4, Computer Search.
Answers which situation the game is in, as the name of a Screen Layout column: human or humanDone in the Human role; in the Computer role codeSetup, searching, running, solved or outOfScans for the phase of the trial and whether Run is on.
safeStateData StructureSafe State- Type
Text- Name
situation
- Variable
situation- Value
'human'
- Action Name
computerCracks- Applies to
safeRules- Logic Component
Computer Role
computerCracks.value == true- Action Name
inSetup- Applies to
safeRules- Game State
Setup
inSetup.value == true- Variable
situation- Value
'codeSetup'
- Action Name
inLocked- Applies to
safeRules- Game State
Locked
inLocked.value == true- Variable
situation- Value
'searching'
- Action Name
inUnlocked- Applies to
safeRules- Game State
Unlocked
inUnlocked.value == true- Variable
situation- Value
'solved'
- Action Name
inExhausted- Applies to
safeRules- Game State
Exhausted
inExhausted.value == true- Variable
situation- Value
'outOfScans'
- Action Name
runIsOn- Applies to
safeRules- Logic Component
Run Search
runIsOn.value == true- Variable
situation- Value
'running'
- Action Name
safeIsOpen- Applies to
safeRules- Game State
Unlocked
- Action Name
scansUsedUp- Applies to
safeRules- Game State
Exhausted
safeIsOpen.value == true || scansUsedUp.value == true- Variable
situation- Value
'humanDone'
- Value
situation
A.30 Human Role
Built in Chapter 4, Computer Search.
What the controls do while the human cracks the safe: Enter scans the entry and R starts a new safe; Space and A only say that the computer needs a locked code. Choose Human Role turns this Logic on.
Any Objectself.safeState- safeRules
self
- safeRules
self
- Variable
$message- Value
data('Safe Copy','No Code Locked','text')
- Variable
$message- Value
data('Safe Copy','No Code Locked','text')
A.31 Lock Code (Function)
Built in Chapter 4, Computer Search.
Locks the entry as the secret code during Setup, if it is a code the safe can have (from the lowest to the highest code). The safe is then Locked and the computer may start its search.
safeStateData StructureSafe State- Action Name
settingCode- Applies to
safeRules- Game State
Setup
settingCode.value == true$entry >= data('Safe Settings','Standard Safe','lowestCode') && $entry <= data('Safe Settings','Standard Safe','highestCode')- Component Value
safeRules.safeState.code- Value
$entry
- Variable
$entry- Value
0
- Applies to
safeRules- Game State
Locked
- Variable
$message- Value
data('Safe Copy','Code Sealed','text')
- Variable
$message- Value
text(data('Safe Copy','Code Outside the Range','text'), ' ', data('Safe Settings','Standard Safe','lowestCode'), ' to ', data('Safe Settings','Standard Safe','highestCode'), '.')
- Variable
$message- Value
data('Safe Copy','Code Sealed','text')
A.32 Reset Trial (Function)
Built in Chapter 4, Computer Search.
Starts a fresh trial on the same safe: every code is possible again, nothing has been scanned, the Scan Log is empty, and the keypad display shows the starting entry.
safeStateData StructureSafe State- Variable
$low- Value
data('Safe Settings','Standard Safe','lowestCode')
- Variable
$high- Value
data('Safe Settings','Standard Safe','highestCode')
- Variable
$scans- Value
0
- Variable
$lastGuess- Value
0
- Component Value
safeRules.safeState.clue- Value
0
- Table
Scan Log
- Variable
$entry- Value
data('Safe Settings','Standard Safe','startEntry')
- Component Value
safeRules.safeState.startsNewEntry- Value
true
A.33 Show For Situation (Function)
Built in Chapter 4, Computer Search.
Shows or hides one piece for the situation the game is in, as its row of the Screen Layout table says.
safeStateData StructureSafe State- Action Name
situationNow- safeRules
safeRules
data('Screen Layout', layoutRow, situationNow.value) == true- Applies to
piece- Visible
true
- Applies to
piece- Visible
false
A.34 Show In Situation
Built in Chapter 4, Computer Search.
Shows this piece only in the situations its row of the Screen Layout table picks (the keypad, the SCAN and LOCK CODE buttons, the RUN and PAUSE buttons, the Watch computer button, the computer's readout, and the rest), and hides it otherwise.
Any Object- piece
self- safeRules
@self.safeRules- layoutRow
@self.layoutRow
- piece
self- safeRules
@self.safeRules- layoutRow
@self.layoutRow
- piece
self- safeRules
@self.safeRules- layoutRow
@self.layoutRow
A.35 Show Search Readout
Built in Chapter 4, Computer Search.
Keeps the computer's readout line up to date: rewritten whenever the range or the phase can have changed.
Any Objectself.readoutLine- readout
self
- readout
self
A.36 Show Selected Role
Built in Chapter 4, Computer Search.
Shows a role tab in gold while its role is the one chosen, and plain otherwise.
Any Object- Action Name
computerCracks- Applies to
@self.safeRules- Logic Component
Computer Role
computerCracks.value == self.isComputerTab- Sprite
Safe Gold
- Sprite
Safe Button
A.37 Start Code Setup (Function)
Built in Chapter 4, Computer Search.
Starts a fresh trial in the Computer role: the player types the code the computer will crack, then locks it.
safeStateData StructureSafe State- safeRules
safeRules
- Component Value
safeRules.safeState.humanScans- Value
0
- Applies to
safeRules- Game State
Setup
- Variable
$message- Value
data('Safe Copy','Choose a Code','text')
A.38 Take a Step (Function)
Built in Chapter 4, Computer Search.
Makes one computer turn while the safe is Locked: Choose Midpoint picks the next guess from the range, the guess is shown in the entry, and Scan Guess scans it, the same scanner the human uses.
safeStateData StructureSafe State- Action Name
safeIsLocked- Applies to
safeRules- Game State
Locked
safeIsLocked.value == true- Action Name
nextGuess- low
$low- high
$high
- Variable
$entry- Value
nextGuess.value
- safeRules
safeRules
- Variable
$message- Value
data('Safe Copy','No Code Locked','text')
A.39 Write Search Readout (Function)
Built in Chapter 4, Computer Search.
Writes the computer's readout line: NEXT GUESS with the midpoint Choose Midpoint picks from the range, or, once the safe is Unlocked, SOLVED IN with the number of scans.
readoutLineData StructureReadout Line- Action Name
searchSolved- Applies to
readout- Game State
Unlocked
searchSolved.value == true- Component Value
readout.readoutLine.heading- Value
data('Safe Copy','Solved In','text')
- Component Value
readout.readoutLine.number- Value
$scans
$scans == 1- Component Value
readout.readoutLine.unit- Value
data('Safe Copy','One Scan','text')
- Component Value
readout.readoutLine.unit- Value
data('Safe Copy','Several Scans','text')
- Action Name
nextGuess- low
$low- high
$high
- Component Value
readout.readoutLine.heading- Value
data('Safe Copy','Next Guess','text')
- Component Value
readout.readoutLine.number- Value
nextGuess.value
- Component Value
readout.readoutLine.unit- Value
''
A.40 Close Myth Lesson (Function)
Built in Chapter 5, Run and Compare.
Closes the Myth Lesson: the lesson's keys turn off, the game's controls turn back on, and lessonChanged tells the lesson's pieces and Run Search.
safeStateData StructureSafe State- Applies to
safeRules- Input Context
Myth Lesson- Active
false
- Applies to
safeRules- Input Context
Game Controls
- Custom Event
lessonChanged
A.41 Lesson Keys
Built in Chapter 5, Run and Compare.
Lets the keyboard open and close the Myth Lesson: F opens it or closes it, and Escape closes it. The Myth lesson and Close buttons call the same Functions.
Any Objectself.safeState- safeRules
self
- safeRules
self
A.42 Open Myth Lesson (Function)
Built in Chapter 5, Run and Compare.
Opens the Myth Lesson: the game's controls turn off (the Game Controls Input Context), the lesson's keys turn on (the Myth Lesson Input Context), and lessonChanged tells the lesson's pieces and Run Search.
safeStateData StructureSafe State- Applies to
safeRules- Input Context
Game Controls- Active
false
- Applies to
safeRules- Input Context
Myth Lesson
- Custom Event
lessonChanged
A.43 Open or Close Myth Lesson (Function)
Built in Chapter 5, Run and Compare.
Closes the Myth Lesson if it is open, and opens it otherwise. F and the Myth lesson button call it.
safeStateData StructureSafe State- Action Name
lessonIsOpen- Applies to
safeRules- Input Context
Myth Lesson
lessonIsOpen.value == true- safeRules
safeRules
- safeRules
safeRules
A.44 Run or Pause (Function)
Built in Chapter 5, Run and Compare.
Pauses the computer's search if Run is on; otherwise turns Run on, if a locked code is waiting to be cracked.
safeStateData StructureSafe State- Action Name
runIsOn- Applies to
safeRules- Logic Component
Run Search
runIsOn.value == true- Applies to
safeRules- Logic Component
Run Search- State
Disable
- Variable
$message- Value
data('Safe Copy','Paused','text')
- Action Name
safeIsLocked- Applies to
safeRules- Game State
Locked
safeIsLocked.value == true- Applies to
safeRules- Logic Component
Run Search
- Variable
$message- Value
data('Safe Copy','No Code Locked','text')
A.45 Run Search
Built in Chapter 5, Run and Compare.
Plays the computer's search on a timer: while this Logic is on, the computerTurn timer takes one Step every runInterval seconds. Turning it on starts the timer; turning it off stops it. It turns itself off once the safe is no longer Locked, or when a role is chosen.
Any Objectself.safeState- Timer Name
"computerTurn"- Repeat Every (s)
data('Safe Settings','Standard Safe','runInterval')- First Delay (s)
data('Safe Settings','Standard Safe','runDelay')
- Custom Event
runChanged
- Timer Name
"computerTurn"
- Custom Event
runChanged
- safeRules
self
- Action Name
safeIsOpen- Game State
Unlocked
- Action Name
scansUsedUp- Game State
Exhausted
- Action Name
settingCode- Game State
Setup
safeIsOpen.value == true || scansUsedUp.value == true || settingCode.value == true- Logic Component
Run Search- State
Disable
- Logic Component
Run Search- State
Disable
- Logic Component
Run Search- State
Disable
A.46 Show Human Result
Built in Chapter 5, Run and Compare.
Shows the human's result beside the computer's search after Watch computer, and hides it again when a role is chosen or a new code is set up.
Any Objectself.resultLine- line
self- safeRules
@self.safeRules
- line
self- safeRules
@self.safeRules
A.47 Show With Lesson
Built in Chapter 5, Run and Compare.
Shows this piece of the Myth Lesson while the lesson is open, and hides it while it is closed.
Any Object- Action Name
lessonIsOpen- Input Context
Myth Lesson
lessonIsOpen.value == true- Visible
Yes
- Visible
No
A.48 Step Once (Function)
Built in Chapter 5, Run and Compare.
Takes one Step by hand: Run is turned off first if it is on, so the computer makes exactly this one turn.
safeStateData StructureSafe State- Applies to
safeRules- Logic Component
Run Search- State
Disable
- safeRules
safeRules
A.49 Watch Computer (Function)
Built in Chapter 5, Run and Compare.
Hands the human's safe to the computer after the human's attempt has ended: keeps the human's result, turns the Computer role on, and starts a fresh trial on the same code, already locked, so the computer searches it at once.
safeStateData StructureSafe State- Component Value
safeRules.safeState.humanScans- Value
$scans
- Action Name
humanUnlocked- Applies to
safeRules- Game State
Unlocked
- Component Value
safeRules.safeState.humanUnlocked- Value
humanUnlocked.value
- Applies to
safeRules- Logic Component
Human Role- State
Disable
- Applies to
safeRules- Logic Component
Computer Role
- safeRules
safeRules
- Variable
$entry- Value
0
- Applies to
safeRules- Game State
Locked
- Variable
$message- Value
data('Safe Copy','Same Code','text')
- Custom Event
roleChosen
A.50 Write Human Result (Function)
Built in Chapter 5, Run and Compare.
Shows the human's kept result on the result line while the computer searches the human's code (after Watch computer), and hides the line otherwise. line: the text that shows the result. safeRules: the Object whose Safe State keeps the human's result (humanScans, humanUnlocked).
resultLineData StructureResult LinesafeStateData StructureSafe State- Action Name
computerCracks- Applies to
safeRules- Logic Component
Computer Role
computerCracks.value == true && safeRules.safeState.humanScans > 0- Component Value
line.resultLine.scansUsed- Value
safeRules.safeState.humanScans
safeRules.safeState.humanScans == 1- Component Value
line.resultLine.scanWord- Value
data('Safe Copy','One Scan','text')
- Component Value
line.resultLine.scanWord- Value
data('Safe Copy','Several Scans','text')
safeRules.safeState.humanUnlocked == true- Component Value
line.resultLine.outcome- Value
data('Safe Copy','Card Unlocked','text')
- Component Value
line.resultLine.outcome- Value
data('Safe Copy','Out of Scans','text')
- Applies to
line- Visible
true
- Applies to
line- Visible
false
