Revision as of 10:50, 17 June 2012 by Hardmath123 (talk | contribs) (BYOB: -template)

Note Warning: This script will close Scratch without saving your work. Be sure to save before testing this.

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.

Scratch

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


Or

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

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 doesn't have the memory to maintain it. Since Scratch runs within the Squeak environment, Scratch closes when the Squeak environment closes.

BYOB

In the Scratch Modification BYOB, a simple recursive block can be used to freeze the program: Freeze-BYOB-compact.png


Alternatively, this script does not need a defined block: Freeze-BYOB.gif