Processing (BETA) version 135+ のリファレンスです。 旧バージョン使用者はソフトウェア内のリファレンスを参照してください。
この文書は Processing のAPIリファレンスを日本語に訳したものです。 最新の内容は 英語版 で確認して下さい。


Name

for()

Examples
example pic
for(int i=0; i<40; i=i+1) {
  line(30, i, 80, i);
}
example pic
for(int i=0; i<80; i=i+5) {
  line(30, i, 80, i);
}
example pic
for(int i=40; i<80; i=i+5) {
  line(30, i, 80, i);
}
example pic
for(int i=30; i<80; i=i+5) {
  for(int j=0; j<80; j=j+5) {
    point(i, j);
  }
}
Description 繰り返し処理を制御します。 for() 文は init, test, update の3つのパートで構成されます。 それぞれのパートは ";" で区切られます。 ループはテストが false になるまで続けられます。
1. init文が実行されます。
2. testの真偽を評価します。
3. testがtrueならばstep.4を実行します。testがfalseならばstep.6を実行します。
4. for文内部の文脈を実行します
5. updateを実行した後、step.2を実行します。
6. ループを脱出します。
Syntax
for(init; test; update) { 
  statements
}
Parameters
init statement executed once when beginning loop
test if the test evaluates to true, the statements execute
update executes at the end of each iteration
statements collection of statements executed each time through the loop
Usage Web & Application
Related while()
Updated on September 23, 2006 05:40:16pm PDT

Creative Commons License

この文書の原文はクリエイティブ・コモンズ(Creative Commons)Attribution-Noncommercial-Share Alike(表示・非営利・継承) ライセンスで公開されています。 このライセンスは同一の許諾条件の下で原作者のクレジットを表示し、また作品を営利目的で利用しなければ、作品に対して複製、頒布、展示、実演、二次的著作物の作成が行えることを示します。

© 2007 Processing.org