課程 4 - 計數迴圈 簡介
-
0:05 - 0:10當您使用重複塊循環代碼時
計算機如何知道何時重複
2
00:00:10,309 --> 00:00:15,860
足夠的次數了?重複塊實際上
隱藏了更複雜的代碼
3
00:00:15,860 --> 00:00:21,590
這個代碼叫做for循環,是從初始
值按照一定增量增直到特定的最終值
4
00:00:21,590 --> 00:00:30,630
例如,從1到3按照增量為1重複3個方塊的計數
每次計數時,
5
00:00:30,630 --> 00:00:35,820
它會在循環內運行代碼。for循環
知道它已經運行了多少次了
6
00:00:35,820 --> 00:00:40,019
因為它使用了計數器變量,設置為
循環開始時的值,並包含
7
00:00:40,019 --> 00:00:44,309
每次循環都會增加增量。
一旦計數器變量是
8
00:00:44,309 --> 00:00:51,360
大於結束值,循環停止
運行。使用實數for循環
9
00:00:51,360 --> 00:00:55,470
而不是重複塊的好處是,你可以
實際看到計數器變量並使用
10
00:00:55,470 --> 00:00:56,160
它在您的循環中。
- Title:
- 課程 4 - 計數迴圈 簡介
- Description:
-
Twitter 工程師 Jie Jin 為你介紹計數迴圈
有空逛逛 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 - Video Language:
- English
- Team:
Code.org
- Project:
- CSF '21-'22
- Duration:
- 0:57
![]() |
TranslateByHumans edited Chinese, Traditional subtitles for Course 4: Intro to For Loops | |
![]() |
TranslateByHumans edited Chinese, Traditional subtitles for Course 4: Intro to For Loops | |
![]() |
奕德 余 edited Chinese, Traditional subtitles for Course 4: Intro to For Loops | |
![]() |
奕德 余 edited Chinese, Traditional subtitles for Course 4: Intro to For Loops | |
![]() |
奕德 余 edited Chinese, Traditional subtitles for Course 4: Intro to For Loops |