This article or section documents something not included in the current version of Scratch (3.0). It is only useful from a historical perspective. For information on the feature that replaced this one, see Scratch File Format (3.0). |
“ | all scripts are converted to tuples before they are saved; each stack is converted to: (where () indicates an array) (position (block1 block2 block3 ...)) |
” |
– nxIII, ar-post:1043186 |
For example, the script:
when I receive [message v]:: control set [var v] to ([sqrt v] of (100)) repeat until <(var)=[1]> wait ((3) - (2)) secs change [var v] by (-1) end say (join [hello ] [world]) if <<touching [Sprite1 v]?> or <key [space v] pressed?>> { broadcast [message v]:: control switch to costume [costume1 v]:: looks }:: control
Gets encoded something like this:
(
Point(20, 20.0),
[
[<#EventHatMorph>, 'message'],
[<#changeVariable>, 'var', <#setVar:to:>, [<#computeFunction:of:>, 'sqrt', 100]],
[<#doUntil>, [<#=>, [<#readVariable>, 'var'], '1'],
[
[<#wait:elapsed:from:>, [<#->, 3, 2]],
[<#changeVariable>, 'var', <#changeVar:by:>, -1]
]
],
[<#say:>, [<#concatenate:with:>, 'hello ', 'world']],
[<#doIf>,
[<#|>, [<#touching:>, <ScratchSpriteMorph(Sprite1)>], [<#keyPressed:>, 'space']],
[
[<#broadcast:>, 'message'],
[<#lookLike:>, 'costume1']
]
]
]
)
Where <#say:> represents the Squeak Symbol "say:", and [] is used interchangeably with () for tuples. (Whitespace added for clarity.)
See Also
- Blockmaking FAQs to find information on block types (blockspecs)
- A post by ScratchReallyROCKS explaining the anatomy of a Scratch block
Files | |
Structure |
Object Table • Inline Values • Objects • Fixed-format Objects • User-class Objects |
Contents |