xxxxxxxxxx
//colors
var b_color;
var w_color;
//stroke size
var st;
//square size
var wsquare;
var hsquare;
//sarting position of each square
var startX
var startY
function setup() {
createCanvas(600, 600);
b_color = '#000000';
w_color = '#ffffff';
st = 1;
//set X and Y
startX = 0;
startY = 0;
//set angle mode
angleMode(DEGREES);
// size of each square
wsquare = 600 / 5;
hsquare = 600 / 5;
}
function draw() {
background(w_color);
//Grid1
fill(b_color);
//set stroke size and color
stroke(b_color);
strokeWeight(st);
//rectangle
rect(startX, startY, wsquare, hsquare);
//arc1
fill(w_color);
arc(startX, startY, wsquare*2, hsquare*2, 0, 90);
//Grid2
fill (w_color);
rect(wsquare, startY, wsquare, hsquare);
//Grid3
fill(w_color);
rect(wsquare*2, startY, wsquare, hsquare);
//Grid4
fill(w_color);
rect(360, startY, wsquare, hsquare);
//arc2
fill(b_color);
arc(480, 120, wsquare*2, hsquare*2, 180, 270);
//Grid5
fill(b_color);
rect (480, startY, wsquare, hsquare);
//Grid6
fill(b_color);
rect(startX, hsquare, wsquare, hsquare);
//arc3
fill(w_color);
arc(startX, hsquare*2 ,wsquare*2, hsquare*2, 270, 0);
//Grid7
fill(b_color);
rect(wsquare, hsquare, wsquare, hsquare);
//arc4
fill(w_color);
arc(wsquare*2, hsquare, wsquare*2, hsquare*2, 90, 180);
//Grid8
fill(b_color);
rect(wsquare*2, hsquare, wsquare, hsquare);
//arc5
fill(w_color);
arc(wsquare*2, hsquare, wsquare*2, hsquare*2, 0, 90);
//Grid9
fill(b_color);
rect(360, hsquare, wsquare, hsquare);
//Circle
fill(w_color);
circle(420, 180, 120);
//Grid10
fill(b_color);
rect(480, hsquare, wsquare, hsquare);
//Grid11
fill(w_color);
rect(startX, hsquare*2, wsquare, hsquare);
//Grid12
fill(w_color);
rect(wsquare, hsquare*2, wsquare, hsquare);
//arc6
fill(b_color);
arc(wsquare*2, wsquare*2, wsquare*2, hsquare*2, 90, 180);
//Grid13
fill(b_color);
rect(wsquare*2, hsquare*2, wsquare, hsquare);
//Grid14
fill(b_color);
rect(360, hsquare*2, wsquare, hsquare);
//Grid15
fill(b_color);
rect(480, hsquare*2, wsquare, hsquare)
//Grid16
fill(w_color);
rect(startX, 360, wsquare, hsquare);
//Grid17
fill(w_color);
rect(wsquare, 360, wsquare, hsquare);
//Grid18
fill(w_color);
rect(wsquare*2, 360, wsquare, hsquare);
//Grid19
fill(w_color);
rect(360, 360, wsquare, hsquare);
//arc7
fill(b_color);
arc(360, 360, wsquare*2, hsquare*2, 0, 90);
//Grid20
fill(w_color);
rect(480, 360, wsquare, hsquare);
//arc8
fill(b_color);
arc(600, 360, wsquare*2, hsquare*2, 90, 180);
//Grid21
fill(w_color);
rect(startX, 480, wsquare, hsquare);
//Grid22
fill(w_color);
rect(wsquare, 480, wsquare, hsquare);
//Grid23
fill(w_color);
rect(wsquare*2, 480, wsquare, hsquare);
//Grid24
fill(b_color);
rect(360, 480, wsquare, hsquare);
//triangle
fill(w_color);
triangle(360, 480, 480, 480, 360, 600);
//Grid25
fill(b_color);
rect(480, 480, wsquare, hsquare);
}