ScratchData LogoScratchData
Back to Tutor-42's profile

Scratch Can Count - 50% of the time

TUTutor-42•Created August 10, 2019
Scratch Can Count - 50% of the time
0
0
7 views
View on Scratch

Instructions

Problems with two "when Green Flag clicked" scripts. A six line project that counts to 3 and plays a musical note three times. * What could possibly go wrong? * Green Flag to run the project. Green Flag to run the project again - different results! The loop alternates repeating 3 times or 0 times. * Now try clicking the Green Flag twice! The project always works correctly. This program has problems because the bottom "when Green Flag clicked" script always runs before the top script when we click the Green Flag. The bottom script is not run first because of its position in the editor. You can drag the two scripts up, down, left or right or put them on top of each other. The bottom script will still run first. Here is a project with identical code that always works because the top "when Green Flag clicked" script always runs before the bottom script: https://scratch.mit.edu/projects/323751012/

Description

https://scratch.mit.edu/discuss/post/3680365/ ** See this tutorial which explains the following topics and more: - why two "when Green Flag scripts" in a project may cause problems (ie. how two "identical" projects run differently because their scripts run in a different order) * how to write projects to fix these problems - why some projects say "Click the Green Flag twice" - how this project works in detail including how scripts pause and yield to allow other scripts to run - how Scratch decides the order to run scripts

Project Details

Project ID323750836
CreatedAugust 10, 2019
Last ModifiedAugust 24, 2019
SharedAugust 24, 2019
Visibilityvisible
CommentsAllowed