<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<canvas width="500" height="500" id="memo"></canvas>
<script>
var canvas = document.getElementById('memo');
var context = canvas.getContext('2d');
var c=new Array();
c[1]="red";
c[2]="pink";
c[3]="yellow";
c[4]="blue";
c[5]="green";
c[6]="black";
c[7]="purple";
c[8]="white";
c[9]="orange";
var x=new Array();
var y=new Array();
tx=0;
for(s=1;s<4;s++){
for(sx=1;sx<4;sx++){
tx=tx+1;
x[tx]=100*s-100;
y[tx]=100*sx-100;
}}
for(s=1;s<10;s++){
context.fillStyle=c[s];
context.fillRect(x[s],y[s],100,100);
}
</script>
</body>
</html>
最終更新:2018年05月31日 00:28