If two items need to switch places, a Boolean variable sort is set to true (lines 46, 49, 86, and 89).
如果两个项目需要调换位置,一个布尔排序变量将设置为true(第46、49、86和89行)。
As an aside, if you ever just have one line of code that you want to execute, one puzzle piece in Scratch terminology, ; you actually don't need the curly braces; you only need the curly braces if you have two or more lines of code that you want to execute if that condition is true.
此外,如果你只有一行代码,需要执行,在Scratch,术语中叫做,一句代码,你就不需要使用花括号了;,如果那个条件成立,你有两行或更多行的代码时需要执行时,你就需要花括号。
应用推荐