Code Sketch
Draw poly randomly
By: Gavin
Category: Programming
0


0




clear setAnimationDelay(100) def poly(numSides: Int, sideLen: Int) = repeat(numSides) { forward(sideLen) right(360 / numSides) } 1 to 9 foreach(i=>{ jumpTo(-1000+(150*i),-100) //设置起始绘制位置 poly(random(5)+3, random(50)+10) //始绘多边形 //打印多边形边数 println("numSides="+random(9)+ "\t sideLen=" + random(50)+10) })





Your Comment:





Login to post a comment