回答

記事一覧 2026
  • クラス-応用11-回答

    Thursday, October 29, 2026 in クラス-応用11

    問題 クラス-応用11 の回答ページです. 回答例 Button btnRed, btnGreen, btnBlue; color bg; // 現在の背景色 void setup() { size(500, 300); noStroke(); bg = color(240); // Button(左上のx, 左上のy, 幅, 高さ, 色) btnRed = new Button( 50, 200, 120, 60, color(230, 60, 60)); btnGreen = new …

    続きを読む

  • クラス-基礎8-回答

    Thursday, October 29, 2026 in クラス-基礎8

    問題 クラス-基礎8 の回答ページです. 回答例 Circle base, body, head; // Circle型の変数を3つ用意する void setup() { size(400, 400); noStroke(); // 下の雪玉 base = new Circle(); base.x = 200; base.y = 290; base.d = 160; // 真ん中の雪玉 body = new Circle(); body.x = 200; body.y = 170; body.d …

    続きを読む

  • クラス-基礎11-回答

    Thursday, October 29, 2026 in クラス-基礎11

    問題 クラス-基礎11 の回答ページです. 回答例 Tree tree1, tree2, tree3; // Tree型の変数を3つ用意する void setup() { size(400, 400); noStroke(); // 奥の木(左) tree1 = new Tree(); tree1.x = 110; tree1.y = 300; // 奥の木(右) tree2 = new Tree(); tree2.x = 290; tree2.y = 300; // 手前の木 tree3 = …

    続きを読む

  • 回答

    Wednesday, October 21, 2026 in クラス-基礎1

    問題 クラス-基礎1 の回答ページです. 回答例 String str1 = "Action is the foundational key"; void setup(){ // "f" が最初に現れるインデックス println(str1.indexOf("f")); // 文字数 println(str1.length()); // 半角スペースで分割し,最初の単語を表示 String[] words = str1.split(" …

    続きを読む

記事一覧 0001
  • 回答

    Monday, January 01, 0001 in 配列-応用7

    問題 配列-応用7 の回答ページです. 回答例 float[] x=new float[5]; int[] muki = new int[5]; color[] colors = new color[5]; void setup(){ size(600,400); for(int i = 0; i<5; i++){ x[i] = 100+ i*80; muki[i] = 1; colors[i] = color(random(256),random(256),random(256)); } …

    続きを読む