3
\$\begingroup\$

It seems to be undisputed precedent for Scratch answers that only the code is counted when determining the bytes used for an answer (although, how to come up with the amount of bytes that the code takes up is disputed, but I'm not getting into that here).

However, a Scratch program is more than code - there's costumes, sounds, the question of what kind of sprite the code is running in, and some other factors. Scratch is also a very unique language with many features present outside of the code.

What assumptions can be made about the environment in Scratch?

\$\endgroup\$

4 Answers 4

3
\$\begingroup\$

The green flag will be clicked once

Unlike traditional programming languages, Scratch code does not execute immediately upon the interpreter reading it - it must be ran by a hat block. Using when gf clicked for this seems to be undisputed precedent, so you may assume that the green flag will be clicked once.

\$\endgroup\$
3
\$\begingroup\$

All variables you use exist, and are set to 0 before your code runs

\$\endgroup\$
3
\$\begingroup\$

There will be no human interaction with the program while it is running

Exception: you may accept input in a sensible format if the challenge requires input.

\$\endgroup\$
2
\$\begingroup\$

Assumptions about the stage/sprite

  • You may either:

    • Assume that your code is running in the stage.

    • Assume that your code is running in a sprite.

      • You may either:
        • make no assumptions about the sprite
        • assume that your code is running in the default cat sprite, and it is in the state it is in upon the creation of a new project (visible, on costume 1, has no graphic effects active, and other factors)
  • You may assume that there are no sprites in the project other than the one your code is running in (or assume that there are no sprites if you assume that your code is running in the stage).

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .