Return to Video

Karlie Kloss 解釋如何在小藝術家關卡使用運算

  • 0:09 - 0:15
    如果我想畫一個長方形,高為 50 像素,寬是高的兩倍。
  • 0:15 - 0:17
    我要編寫什麼程式讓電腦照做?
  • 0:18 - 0:24
    這樣吧,我可以告訴小藝術家往上走 50 點,向左轉,接著走 100 點。
  • 0:24 - 0:29
    這程式要做兩次,但接下來我要電腦自己做這件事情。
  • 0:29 - 0:32
    在你頭腦中算出 50 乘以 2 也許不難,
  • 0:32 - 0:35
    但是計算機更擅長做這樣的計算題,
  • 0:35 - 0:38
    因此我們應該盡量讓計算機來做這些運算。
  • 0:38 - 0:41
    如果我就用一個叫做 height(高度)的變量,
  • 0:41 - 0:44
    那麼我就能很容易的將 height 設定為 50,
  • 0:44 - 0:47
    並且將我的算法改為告訴小藝術家
  • 0:47 - 0:52
    往上走 height ,向右轉,然後走 height 的 2 倍。
  • 0:52 - 0:56
    這也會給我們一個寬度是高度的兩倍的長方形。
Title:
Karlie Kloss 解釋如何在小藝術家關卡使用運算
Description:

開始學習,就在 http://code.org/

隨時與我們保持聯繫!
• 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
Duration:
0:58

Chinese, Traditional subtitles

Revisions