Return to Video

Saloni teaches If-Else statements with Scrat the Squirrel from Ice Age

  • 0:00 - 0:06
    if-else语句是两件事情之间二选一。例如,如果松鼠Scrat
  • 0:06 - 0:12
    发现橡子,那么他会很高兴。否则,他会很难过,并继续寻找。现在让我们来看看
  • 0:12 - 0:17
    我们如何与我们的伙伴Scrat一起使用一个if-else语句。这一块看起来很像“if”
  • 0:17 - 0:22
    块,但在它的的底部有一个额外的部分,上面写着“else”。如果我把一个“move forward”
  • 0:22 - 0:27
    块放在“do”区域,一个“turn left”放在“else”区域,这意味着,如果前方有路
  • 0:27 - 0:32
    松鼠Scrat会向前移动。反之,
  • 0:32 - 0:37
    Scrat将左转。它作出决定并基于这个决定去完成这两个动作中的一个。
  • 0:37 - 0:42
    并且和“if”块,你可以把“if-else”放在“repeat”块里。
  • 0:42 - 0:46
    现在,让我们帮助松鼠Scrat找到那颗橡子吧!
Title:
Saloni teaches If-Else statements with Scrat the Squirrel from Ice Age
Description:

more » « less
Video Language:
English
Team:
Code.org
Project:
Hour of Code
Duration:
0:50

Chinese, Simplified subtitles

Revisions