目次
学習日
2025年6月19日
名前
細川紗羅
自分で作った図形(コードと画像)
✅ 練習問題 1-6-1a
function setup() {
createCanvas(400, 400);
background(220);
stroke(255);
fill(255);
rect(100, 120, 200, 150);
stroke(188, 0, 45);
fill(188, 0, 45);
ellipse(200, 195, 80);
}📷 実行結果

✅ 練習問題 1-6-1b
function setup() {
createCanvas(400, 400);
background(220);
stroke(0, 106, 167);
fill(0, 106, 167);
rect(100, 120, 200, 150);
stroke(254, 204, 0);
fill(254, 204, 0);
rect(160, 120, 40, 150);
rect(100, 175, 200, 40)
}📷 実行結果

✅ 練習問題 1-6-1c
function setup() {
createCanvas(400, 400);
background(220);
stroke(255);
fill(255);
rect(100, 120, 200, 150);
stroke(255, 0, 0);
fill(255, 0, 0);
rect(180, 120, 40, 150);
rect(100, 175, 200, 40);
rect(130, 135, 10, 30);
rect(120, 145, 30, 10);
rect(260, 135, 10, 30);
rect(250, 145, 30, 10);
rect(130, 230, 10, 30);
rect(120, 240, 30, 10);
rect(260, 230, 10, 30);
rect(250, 240, 30, 10);
}📷 実行結果

✅ 練習問題 1-6-1d
function setup() {
createCanvas(400, 400);
background(220);
stroke(255);
fill(255);
rect(100, 120, 200, 150);
stroke(224, 82, 6);
fill(224, 82, 6);
rect(100, 120, 200, 50);
ellipse(200, 195, 40);
stroke(13, 176, 43);
fill(13, 176, 43);
rect(100, 220, 200, 50);
}📷 実行結果

工夫したこと
工夫したことは2つある。
1.4つ全ての国旗の大きさを同じにした。
↳3等分にできたり、半分に分けられるような大きさを考えながら大きさを作ることができた。
2.色をそれぞれ調べながら、特徴をとらえて国旗をそれぞれ作ることができた。
ポイント👆
・国旗の色を3等分にしたいときは、その国旗自体の大きさを3の倍数にする