<html>
<head>
<meta charset="utf-8">
<title>ABC</title>
<script src="jquery.js"></script>
<script src="sample.js"></script>
<script src="svgpaint.js"></script>
</head>
<body onload="sample()">
<div id="memo"></div>
</body></html>
var x = new Array();
var y = new Array();
var ball = new Array();
function sample(){
tx=0;
for(s=1;s<11;s++){
for(sx=1;sx<11;sx++){
tx=tx+1;
x[tx]=s;
y[tx]=sx;
}}
for (s = 1; s < 101;s++ ){
ball[s]=0;
}
for (s = 1; s < 51;s++ ){
ball[s]=100;
}
paint();
}
function paint(){
var sub=new svgpaint();
str="<svg width=\"700\" height=\"700\">";
for(s=1;s<101;s++){
if(ball[s]>60)str=str+sub.rect(50*x[s],50*y[s],50,50,"red");
if(ball[s]<60)str=str+sub.rect(50*x[s],50*y[s],50,50,"blue");
}
str=str+"</svg>";
$("#memo").html(str);
}
最終更新:2015年06月10日 02:00