< Return to Video

CS Fundamentals: How to Create a Simple Function

  • 0:05 - 0:10
    您已經學會了使用和編輯函數
    作為高效程序的一部分
  • 0:10 - 0:16
    現在,讓我們學習如何創建
    並從頭開始使用函數。
  • 0:16 - 0:21
    要做這個的話,在工具箱中尋找名為
    函數的功能。在這裡,你會看到
  • 0:21 - 0:26
    一個叫做“do something(做事情)”的模塊。拖動模塊
    進入您的工作區並將它重新命
  • 0:26 - 0:31
    用一個更好的名字來描述您的
    函數將會執行的操作。我將這個函數
  • 0:31 - 0:37
    叫做“make a square(畫正方形)”。在這裡,
    您可以將模塊拖動到函數中
  • 0:37 - 0:45
    指定您在使用函數功能時會發生什麼。
    用我們的函數創建完成後
  • 0:45 - 0:50
    您會看到一個新的“畫正方形”
    方格出現在工具箱中的
  • 0:50 - 0:56
    函數標籤下,以便我們可以
    使用或從程序中“調用”我們創建的函數
  • 0:56 - 1:01
    這一步很重要,卻很容易忘記
    好的,是時候
  • 1:01 - 1:09
    繼續,並把您的創意發揮到
    您所創建的函數上了
Title:
CS Fundamentals: How to Create a Simple Function
Description:

Start learning at http://code.org/

Stay in touch with us!
• on Twitter https://twitter.com/codeorg
• on Facebook https://www.facebook.com/Code.org
• on Instagram https://instagram.com/codeorg
• on Tumblr https://blog.code.org
• on LinkedIn https://www.linkedin.com/company/code-org
• on Google+ https://google.com/+codeorg

more » « less
Video Language:
English
Team:
Code.org
Project:
CSF '21-'22
Duration:
01:13

Chinese, Traditional subtitles

Revisions