- Learn
- Tutorials
- Algorithms
- Cocktail Shaker Sort
- Appendices
- D Tuning Tables
Appendix D — Tuning Tables
The numbers that make Picture Puzzle 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 Board Slots
The board, one row per slot in reading order: Slot 1 is the top-left slot, and the slots count left to right, then top to bottom. Logic reads a row by its index, 0 for Slot 1. piece is the ID of the piece in the slot now; a piece is home when its ID equals the row index. startPiece is the starting arrangement that Reset puts back; Shuffle makes a new one. The table starts empty: Make Board adds one row for each slot when the game begins.
D.1.2 Messages
The words the game shows. Each row is one situation; words is what the player reads. Most rows are sentences for the Message Line; sortButton and pauseButton are the Sort Button’s label while the sort is stopped and while it runs; forwardPass and backwardPass name the computer’s pass on the lesson panel, which also shows swapped and kept for the last comparison; uploaded and uploadFailed tell how Upload went.
Reset.Choose another piece.Picture complete.Swapped.Kept.This puzzle needs each home position exactly once.Paused.SortPauseForward pass.Backward pass.Picture loaded.Could not open that image. Try a PNG, JPEG or WebP.D.1.3 Outline Colors
The colors of the Outlines behind the pieces, one row per meaning: normal, focus (the keyboard focus and a pressed piece), selected (the first piece chosen), compared (the pair the computer compared last), settled (a slot outside the unsorted range). color is the color of the Outline for that meaning.
#46615a#2579bc#f3d49c#e3b76d#78b99aD.1.4 Piece Counts
The piece counts the player can choose, one row per count, from the smallest to the largest (Make Board makes the board once for the last row); each Count Button names its row. gridSize is how many pieces fill one row of the board (the board holds gridSize x gridSize pieces). piecesColumn names the column of Pictures that holds a picture cut into that many pieces.
3pieces95pieces258pieces64D.1.5 Pictures
The pictures the player can choose, one row per picture; each Picture Button names its row, and Upload uses the row Uploaded, whose Sprites hold the player’s own picture once it is uploaded. preview is the whole picture, shown beside the board and over it once the picture is complete. pieces9, pieces25 and pieces64 are the picture cut into 9, 25 and 64 pieces: frame N of each is the piece whose ID is N.
Village PictureVillage Pieces 9Village Pieces 25Village Pieces 64Forest PictureForest Pieces 9Forest Pieces 25Forest Pieces 64Harbor PictureHarbor Pieces 9Harbor Pieces 25Harbor Pieces 64Uploaded PictureUploaded Pieces 9Uploaded Pieces 25Uploaded Pieces 64D.1.6 Sort Speeds
How quickly Sort runs the computer’s sort, one row per speed the player can choose. intervalSeconds is the time between two rings of the pictureSort timer; comparisonsPerTick is the most comparisons one ring asks for (each is one Step); slideSeconds is how long the two pieces of a computer swap slide, at that speed, whether the swap came from Sort or from Step.
0.410.350.0610.180.0167160.07D.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.
LAY OUT SLOT
drawnSlotSide .............. 70
PLAYER EXCHANGE
exchangeSlideSeconds ....... 0.22
