TutorialsBinary Search

Appendix D — Tuning Tables

The numbers that make Crack the Safe play the way it does. Change them to remix the game: the game’s Logic reads them from here. Try one change at a time, and run the game after each. If something stops working, put the old number back.

D.1 Data Tables

D.1.1 Safe Settings

The tuning numbers of one safe. lowestCode and highestCode: the smallest and largest code the safe can have (both included). startEntry: the number the keypad display shows before the player types. scanBudget: the most scans one trial allows. runDelay: the seconds from pressing Run to the computer’s first turn. runInterval: the seconds between the computer’s turns while Run is on.

Data TableSafe SettingsData Structure: Safe Settings Entry
Row 0Standard Safe
lowestCode1
highestCode100
startEntry50
scanBudget7
runDelay0.25
runInterval0.9

D.1.2 Safe Copy

The words the player reads, one row per message or label that Logic picks, named for it (for example Higher Than, or Card Higher for a Scan Card). text: the words shown (on the message line under the safe, on a Scan Card, or on the computer’s readout).

Data TableSafe CopyData Structure: Safe Copy Entry
Row 0Scan a Guess
textScan a guess to get a clue.
Row 1Higher Than
textHIGHER THAN
Row 2Lower Than
textLOWER THAN
Row 3Unlocked
textUNLOCKED!
Row 4Out of Scans
textOUT OF SCANS
Row 5Outside the Range
textUse the remaining range.
Row 6Start a New Safe
textStart a new safe.
Row 7Code Sealed
textCode sealed.
Row 8Possibilities Remain
textpossibilities remain
Row 9One Possibility Remains
textpossibility remains
Row 10Card Higher
textHIGHER
Row 11Card Lower
textLOWER
Row 12Card Unlocked
textUNLOCKED
Row 13Choose a Code
textCan the computer crack your code?
Row 14Code Outside the Range
textChoose a code from
Row 15No Code Locked
textSet and lock a code first.
Row 16Next Guess
textNEXT GUESS:
Row 17Solved In
textSOLVED IN
Row 18One Scan
textSCAN
Row 19Several Scans
textSCANS
Row 20Paused
textPaused.
Row 21Same Code
textSame code. Computer's turn.

D.1.3 Scan Log

The record of the current trial, one row per scan, added by Record Scan: row “Scan 1” is the first scan. guess: the code scanned. clue: what the scan told (1 the code is higher, -1 lower, 0 the guess is the code). low and high: the range of codes still possible after the clue. The table starts empty, and a new safe empties it again.

Data TableScan LogData Structure: Scan Log Entry

D.1.4 Screen Layout

Which pieces the screen shows in each situation: one row per piece (the Keypad row is every keypad key), one yes/no column per situation. human and humanDone: the Human role while the safe is Locked, and once the attempt has ended (Unlocked or Exhausted). codeSetup, searching, running, solved, outOfScans: the Computer role while the player sets up a code (Setup), while the computer searches (Locked) with Run off or on, once the safe is open (Unlocked), or out of scans (Exhausted).

Data TableScreen LayoutData Structure: Screen Layout Entry
Row 0Keypad
humanYes
codeSetupYes
searchingNo
solvedNo
outOfScansNo
humanDoneYes
runningNo
Row 1Entry Caption
humanYes
codeSetupNo
searchingNo
solvedNo
outOfScansNo
humanDoneYes
runningNo
Row 2Scan Button
humanYes
codeSetupNo
searchingNo
solvedNo
outOfScansNo
humanDoneYes
runningNo
Row 3New Safe Button
humanYes
codeSetupNo
searchingNo
solvedNo
outOfScansNo
humanDoneYes
runningNo
Row 4Human Goal
humanYes
codeSetupNo
searchingNo
solvedNo
outOfScansNo
humanDoneYes
runningNo
Row 5Computer Goal
humanNo
codeSetupYes
searchingYes
solvedYes
outOfScansYes
humanDoneNo
runningYes
Row 6Code Caption
humanNo
codeSetupYes
searchingNo
solvedNo
outOfScansNo
humanDoneNo
runningNo
Row 7Lock Code Button
humanNo
codeSetupYes
searchingNo
solvedNo
outOfScansNo
humanDoneNo
runningNo
Row 8Change Code Button
humanNo
codeSetupNo
searchingYes
solvedYes
outOfScansYes
humanDoneNo
runningYes
Row 9Step Button
humanNo
codeSetupNo
searchingYes
solvedNo
outOfScansNo
humanDoneNo
runningYes
Row 10Search Title
humanNo
codeSetupNo
searchingYes
solvedYes
outOfScansYes
humanDoneNo
runningYes
Row 11Search Readout
humanNo
codeSetupNo
searchingYes
solvedYes
outOfScansNo
humanDoneNo
runningYes
Row 12Last Guess Caption
humanNo
codeSetupNo
searchingYes
solvedNo
outOfScansYes
humanDoneNo
runningYes
Row 13Midpoint Formula
humanNo
codeSetupNo
searchingYes
solvedNo
outOfScansNo
humanDoneNo
runningYes
Row 14Found Code Caption
humanNo
codeSetupNo
searchingNo
solvedYes
outOfScansNo
humanDoneNo
runningNo
Row 15Run Button
humanNo
codeSetupNo
searchingYes
solvedNo
outOfScansNo
humanDoneNo
runningNo
Row 16Pause Button
humanNo
codeSetupNo
searchingNo
solvedNo
outOfScansNo
humanDoneNo
runningYes
Row 17Watch Computer Button
humanNo
codeSetupNo
searchingNo
solvedNo
outOfScansNo
humanDoneYes
runningNo

D.2 Logic Numbers

The numbers and colors each Logic Component keeps in its Shared Variables and Per Instance Variables, with the Starting Value its card gives. A value set on its Object, under Variables in the Properties, or on a placement in the Scene, wins over the value here.

TYPE ITS DIGIT
  digit ...................... 0
SHOW CODE MARK
  lastGuessColor ............. #f3c569
  inRangeColor ............... #48bab5
  ruledOutColor .............. #263b47
LAY OUT SCAN RECORD
  stripLeft .................. 54.15
  stripWidth ................. 970
  markTop .................... -629
  rowLeft .................... 51.5
  rowWidth ................... 973
  cardRoom ................... 139
  cardTop .................... -695
  guessTop ................... -685
  clueTop .................... -707