2
\$\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\$
3
\$\begingroup\$

All variables are set to 0 before your code runs

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

The program is not running in Turbo Mode

(Scratch normally waits for the screen to refresh in between running each block. In Turbo Mode, it doesn't do this.)

\$\endgroup\$
4
  • 2
    \$\begingroup\$ I think this could do with some more explanation for those less familiar with Scratch \$\endgroup\$ – caird coinheringaahing Mar 4 at 22:30
  • \$\begingroup\$ @cairdcoinheringaahing Scratch normally waits for the screen to refresh in between running each block. In Turbo Mode, it doesn't do this. This shouldn't make much of a difference for the kind of challenges that are featured here, but I'm just covering my bases. (Theoretically, one possible advantage to being able to assume that Turbo Mode is off would be that your code will take no less than a predictable amount of time to run.) \$\endgroup\$ – qarz Mar 5 at 1:55
  • 1
    \$\begingroup\$ I did mean more "Edit some details into the post", similar to what you've done with the other two Scratch specific answers. If you edit it in, the system preserves it, whereas comments can be deleted at the author's (and moderators') whim \$\endgroup\$ – caird coinheringaahing Mar 5 at 1:58
  • \$\begingroup\$ @cairdcoinheringaahing Ah, ok \$\endgroup\$ – qarz Mar 5 at 1:59
2
\$\begingroup\$

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

Exception: you may assume that there will be a response to an ask [] and wait prompt if the challenge requires input.

\$\endgroup\$
1
\$\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\$
1
\$\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\$

You must log in to answer this question.

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