level 3
情歌virious
楼主
码在下面了!图一是老师给的例子图二是我做出来的,图片上右下角那些线我怎么也想不出来怎么码了!有大神解救一下吗![[泪]](/static/emoticons/u6cea.png)
![[泪]](/static/emoticons/u6cea.png)
万分感谢
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
}
let spacing = 24;
function setup() {
let sideLength = min(windowWidth, windowHeight);
sideLength -= sideLength % (spacing * 2);
createCanvas(sideLength, sideLength);
background(0);
}
function draw() {
stroke(60);
for (let x = 0; x < width; x += spacing) {
line(x, 0, x, height);
}
stroke(110);
for (let y = 0; y < height; y += spacing) {
if (y > height / 2) {
line(0, y, width, y);
} else {
line(width / 2, y, width, y);
}
stroke(160);
for (let x1 = 0; x1 < width + 1000; x1 += spacing) {
line(x1, height / 2, 0, x1 + height / 2);
}
}}



2021年03月17日 14点03分
1
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
}
let spacing = 24;
function setup() {
let sideLength = min(windowWidth, windowHeight);
sideLength -= sideLength % (spacing * 2);
createCanvas(sideLength, sideLength);
background(0);
}
function draw() {
stroke(60);
for (let x = 0; x < width; x += spacing) {
line(x, 0, x, height);
}
stroke(110);
for (let y = 0; y < height; y += spacing) {
if (y > height / 2) {
line(0, y, width, y);
} else {
line(width / 2, y, width, y);
}
stroke(160);
for (let x1 = 0; x1 < width + 1000; x1 += spacing) {
line(x1, height / 2, 0, x1 + height / 2);
}
}}


