var x=new Array();
function sample(){
for(s=1;s<6;s++){
x[s]=new Array();
}
for(s=1;s<6;s++){
for(sx=1;sx<6;sx++){
x[s][sx]=0;
}}
var timer;
var delay = 100;
x1=1;
y1=1;
var loop = function () {
x1=x1+1;
if(x1>5)y1=y1+1;
if(x1>5)x1=1;
if(y1>5)y1=1;
x[y1][x1]=100;
paint();
clearTimeout(timer);
timer = setTimeout(loop, delay);
}
loop();
}
function paint(){
var sub=new svgpaint();
str="<svg width=\"500\" height=\"500\">";
for(s=1;s<6;s++){
for(sx=1;sx<6;sx++){
str=str+sub.rect(100*sx-100,100*s-100,100,100,"red");
if(x[s][sx]<50)str=str+sub.rect(100*sx-100,100*s-100,100,100,"blue");
}}
str=str+"</svg>";
$("#memo").html(str);
}
最終更新:2016年09月24日 17:41