くりかえし処理③
規則を見つけるのがむずかしい(for文が単純に使えない)とき
/**
* Copyright N.YUUKI ( http://wonderfl.net/user/N.YUUKI )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/lIVS
*/
// forked from shmdmoto's 異なる大きさの正方形を描く
package
{
import frocessing.display.F5MovieClip2D;
*/
public class GraphicExample extends F5MovieClip2D
{
public function setup() : void
{
rectMode(CENTER);
var sqSize:Array;
sqSize = new Array(30,20,50,10,40,15,25,45);
var i:int;
var x:Number = 50;
for(i=0;i<=7;i=i+1)
{rect(x*i,100,sqSize[i-1],sqSize[i-1]);}
var SS:Array;
SS = new Array(10,30,50,40,15,20,35,45);
var j:int;
for(j=0;j<=7;j=j+1)
{rect(100,50*j,SS[j],40);}
}
}
}