xxxxxxxxxx
// colors
var b_color;
var w_color;
// stroke size
var stW;
// size of square
var wSquare;
var hSquare;
// starting position of each square
var startX;
var startY;
function setup() {
createCanvas(600,600);
background(100);
b_color = '#000000';
w_color = '#ffffff';
stW = 1;
// calculate the size of each square
wSquare = 600 / 5;
hSquare = 600 / 5;
// set starting position
startX = 0;
startY = 0;
// set angle mode
angleMode (DEGREES);
}
function draw() {
background (w_color);
// grid 1
fill (w_color);
// set stroke color and size
stroke (b_color);
strokeWeight (stW);
rect(startX, startY, wSquare, hSquare);
// grid 2
fill (w_color);
// set stroke color and size
stroke (b_color);
strokeWeight (stW);
rect(120, startY, wSquare, hSquare);
// grid 3
fill (w_color);
// set stroke color and size
stroke (b_color);
strokeWeight (stW);
rect(240, startY, wSquare, hSquare);
// grid 4
fill (b_color);
rect(360, startY, wSquare, hSquare);
// draw the arc -bottom- left black
fill (w_color);
arc(480, 120, wSquare*2, hSquare*2, 180, 270);
// grid 5
fill (b_color);
rect(480, startY, wSquare, hSquare);
// draw the arc -bottom- left black
fill (w_color);
arc(480, 120, wSquare*2, hSquare*2, 270, 0);
// grid 6
fill (b_color);
rect(startX, 120, wSquare, hSquare);
// draw the arc -bottom- left black
fill (w_color);
arc(120 , 240, wSquare*2, hSquare*2, 180, 270);
// grid 7
fill (w_color);
rect(120, 120, wSquare, hSquare);
// draw the arc -bottom- left black
fill (b_color);
arc(120, 240, wSquare*2, hSquare*2, 270, 0);
// grid 8
fill (w_color);
// set stroke color and size
stroke (b_color);
strokeWeight (stW);
rect(240, 120, wSquare, hSquare);
// grid 9
fill (w_color);
// set stroke color and size
stroke (b_color);
strokeWeight (stW);
rect(360, 120, wSquare, hSquare);
// grid 10
fill (b_color);
rect(480, 120, wSquare, hSquare);
// draw the arc -bottom- left black
fill (w_color);
arc(480, 120, wSquare*2, hSquare*2, 0, 90);
// grid 11
fill (w_color);
// set stroke color and size
stroke (b_color);
strokeWeight (stW);
rect(startX, 240, wSquare, hSquare);
// grid 12
fill (w_color);
// set stroke color and size
stroke (b_color);
strokeWeight (stW);
rect(120, 240, wSquare, hSquare);
// grid 13
fill (b_color);
rect(240, 240, wSquare, hSquare);
// draw a circle at center
fill(w_color);
circle(300, 300,100);
// grid 14
fill (b_color);
// set stroke color and size
stroke (b_color);
strokeWeight (stW);
rect(360, 240, wSquare, hSquare);
// grid 15
fill (w_color);
rect(480, 240, wSquare, hSquare);
// draw the arc -bottom- left black
fill (b_color);
arc(480, 240, wSquare*2, hSquare*2, 0, 90);
// grid 16
fill (w_color);
// set stroke color and size
stroke (b_color);
strokeWeight (stW);
rect(startX, 360, wSquare, hSquare);
// grid 17
fill (w_color);
// set stroke color and size
stroke (b_color);
strokeWeight (stW);
rect(120, 360, wSquare, hSquare);
// grid 18
fill (b_color);
rect(240, 360, wSquare, hSquare);
// draw the arc -bottom- left black
fill (w_color);
arc(240, 480, wSquare*2, hSquare*2, 270, 0);
// grid 19
fill (b_color);
rect(360, 360, wSquare, hSquare);
// draw the arc -bottom- left black
fill (w_color);
arc(360, 480, wSquare*2, hSquare*2, 270, 0);
// grid 20
fill (b_color);
rect(480, 360, wSquare, hSquare);
// draw the arc -bottom- left black
fill (w_color);
arc(480, 480, wSquare*2, hSquare*2, 270, 0);
// grid 21
fill (w_color);
// set stroke color and size
stroke (b_color);
strokeWeight (stW);
rect(startX, 480, wSquare, hSquare);
// grid 22
fill (b_color);
rect(120, 480, wSquare, hSquare);
// draw the arc -bottom- left black
fill (w_color);
arc(240, 480, wSquare*2, hSquare*2, 90,180);
// grid 23
fill (w_color);
rect(240, 480, wSquare, hSquare);
// draw the arc -bottom- left black
fill (b_color);
arc(240, 480, wSquare*2, hSquare*2, 0, 90);
// grid 24
fill (w_color);
// set stroke color and size
stroke (b_color);
strokeWeight (stW);
rect(360, 480, wSquare, hSquare);
// grid 25
fill (w_color);
// set stroke color and size
stroke (b_color);
strokeWeight (stW);
rect(480, 480, wSquare, hSquare);
}