积木——“重复执行( )次”
-
先修科目
- 积木——“重复执行”
说明
我们经常需要让角色重复做多次动作。例如,为了让小狗打转,我们就需要让它向右转4次:
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/4996800d-5efc-4dd8-bacf-15423b9e2473.gif" width="500" style="border-radius: 5px; border: 1px solid #29622d;">
利用积木“重复执行( )次”,就能让这个程序简单得多。积木:“重复执行( )次”
这个积木会把它“嘴”里的积木重复执行一定次数:
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/866f82b7-18d1-43ea-bf71-00b7cf9fc790.png" width="350" style="">
示例
例如,我们可以这样重写上面的程序:
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/38baac56-bc5b-4b44-ad27-1a529ec8397e.gif" width="530" style="">
显然,这个程序更简单,也更容易让别人看懂。假如我们要让小狗转1000次,如果没有这个重复执行积木,程序就太长了以至于没办法实现。
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/6f18626b-2148-4fb2-a3dd-740ff1faf7a8.png" width="280" style="filter: drop-shadow(0.35rem 0.35rem 0.4rem rgba(0, 0, 0, 0.5));">
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login