麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 學院 > 開發設計 > 正文

ChucK初步(6)

2019-11-11 07:16:12
字體:
來源:轉載
供稿:網友

control structures

if / elsewhile & do…while…untilforbreak / continue

Control Structures

ChucK includes standard control structures similar to those in most PRogramming languages. A condition (of type ‘int’) is evaluated and then a proceeding block is potentially executed. Blocks are separated either by semicolons(分號) or by curly brackets(花括號).

if / else

The if statement executes a block if the condition is evaluated as non-zero.

if( condition ){ // insert code here}

In the above code, condition is any expression that evaluates to an int. (條件是一個值為整數的表達式)

The else statement(聲明) can be put after the if block to handle the case where the condition evaluates(求值) to 0.

if( condition ){ // your code here}else{ // your other code here}

If statements can be nested(嵌套).

while & do…while…

// here is an infinite loopwhile( true ){ // your code loops forever! // (sometimes this is desirable because we can create // infinite time loops this way, and because we have // concurrency)} do { // your code executes here at least once} while( condition );

A few more points:

while statements can be nested.see break/continue for additional(附加的) control over your loops

until

The until statement is the opposite of while, semantically(語義地). A until loop repeatedly executes the body until the condition evaluates as non-zero.

// an infinite loopuntil( false ){ // your great code loops forever!}

A few more points:

while statements can be nested.see break/continue for additional(附加的) control over your loops

for

A loop that iterates(迭代) a given number of times.(迭代給定次數) A temporary(暫時的) variable(變量) is declared that keeps track(跟蹤) of the current index and is evaluated and incremented at each iteration(迭代).

// for loopfor( 0 => int foo; foo < 4 ; foo++ ){ // debug-print value of 'foo' <<<foo>>>;}

break / continue

Break allows the program flow to jump out of a loop.

// infinite loopwhile( 1 ){ if( condition ) break;}

Continue allows a loop to continue looping but not to execute(實行) the rest of the block for the iteration where continue was executed.(跳過當前的循環)

// another infinite loopwhile( 1 ){ // check condition if( condition ) continue; // some great code that may get skipped (if continue is taken)}
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 黄色片网站免费在线观看 | 福利在线小视频 | 国产一级毛片不卡 | 黄色毛片视频在线观看 | 久久99国产伦子精品免费 | 精品久久久久久国产 | 国产噜噜噜噜久久久久久久久 | 欧美一区黄色 | 九九热视频这里只有精品 | 羞羞视频.www在线观看 | 中文字幕网在线 | 亚洲午夜免费 | 免费观看一级淫片 | 久久精品亚洲精品国产欧美kt∨ | 女教师~淫辱の动漫在线 | 中文字幕精品一二三四五六七八 | 91在线精品亚洲一区二区 | 成人免费在线网 | 久久毛片 | 性欧美视频在线观看 | 高清做爰免费无遮网站挡 | 免费永久看羞羞片网站入口 | 日本一区二区不卡在线观看 | 369看片你懂的小视频在线观看 | 视频在线亚洲 | 视频毛片| 九九精品在线观看视频 | 99成人精品视频 | 国产免费福利视频 | 性片免费看 | 黑人一级片视频 | 精品中文字幕久久久久四十五十骆 | 中国成人在线视频 | 毛片免费大全短视频 | 亚洲人片在线观看 | 久久久久久久久久久国产精品 | 特级a欧美做爰片毛片 | 成人啪啪18免费网站 | 免费一级a毛片在线播放视 日日草夜夜操 | 在线成人免费视频 | 欧美日韩在线播放一区 |