Making Scratch Crash (1.4)

Материал из Поле цифровой дидактики

Шаблон:Obsolete feature Шаблон:Other version Шаблон:Warning

It is simple to make a project that closes when the Green Flag is clicked. This has been one way users try to prevent remixing, though it is actively discouraged by the Scratch Team. It has also not been successful, as you can open a remixed project without ever pressing the Green Flag. This is called making Scratch crash.

Method 1: Variables

  1. Create a project.
  2. Make a local variable called "variable".
  3. Add the following code to a sprite:
when gf clicked
hide
set [variable v] to [2]
forever
   set [variable v] to ((variable) * (variable))
   set [variable v] to ((variable) * (variable))
end

Or

when gf clicked
hide
set [variable v] to [2]
forever
   change [variable v] by ([10 ^ v] of (variable))
end

Or

when gf clicked
hide
set [variable v] to [12]
forever
 set [variable v] to ((variable) * (variable))

Explanation

This script will fill Squeak's memory, and will force it to close. Squeak automatically crashes when a variable reaches a very high amount as it does not have the memory to maintain it. Since Scratch runs within the Squeak environment, Scratch closes when the Squeak environment closes. If a high RAM has been allotted to Scratch or if this is tested on Scratch 2.0, it may just say "Infinity", and not close.

Method 2: Graphic Effects

  1. Get into the Scratch 1.4 Source Code and open the System Browser.
  2. Add 'water ripple' near the rest of the graphic effect names in Scratch-Objects >> ScriptableScratchMorph instance >> looks ops >> graphicEffectNames
  3. Save the changes and close the System Browser.
  4. Drag out a Set () Effect to () block and choose "water ripple" from the dropdown and set the value to 1 or higher. When the block is clicked, it will crash Scratch. Note that Squeak doesn't have enough memory to run the effect, so it crashes instead.<ref>projects:1504686</ref><ref>scratch:static/projects/rubiks cube guy238/1504686.sbШаблон:Dead link</ref>
when gf clicked
set [water ripple v] effect to ((1)/(0))

Method 3: Hacked Block

  1. Get into the Scratch 1.4 Source Code and open the System Browser.
  2. In Scratch-Objects >> ScriptableScratchMorph class >> block specs >> blockSpecs add ('close Scratch' #- #closeScratch) at the end of the 'control' section
  3. Add the following in Scratch-Objects >> ScriptableScratchMorph instance >> other ops
closeScratch
	Smalltalk snapshot: false andQuit: true
  1. Save both the changes and close the System Browser.
  2. Drag out the close Scratch block that was just made, and run the block. Instead of crashing, Scratch closes without a warning.
when gf clicked
close Scratch :: control

References

<references/>