Processing questionPlease

Asked 2 years ago, Updated 2 years ago, 74 views

void setup() {
  size(400, 400);
  background(190, 255, 255);
  strokeWeight(30);
  stroke(0, 0, 0, 50);
  int a = 0;
  int b = 10;
  int c = 7;
  int d = random(8, 16, 20);
  point(a, b);
}
for (i = a; i <= width; i += a + d) {
  if (j = b i > 400; j += b);
  e = true;
} } else {
  e = false;
}
if (e == true) {
  point(i, b);
}
if (c == false) {
  point(i, b + 10);
}
void draw() {
}

point (a, b) To a d (random value) is added to and are listed, I hope. Y b in the 10 is added and I hope it will be listed.

I'm in a hurry. Help me

     □               □               □

    (a,b)           (a+d,b)         (a+d2,b)



     □               □               □

   (a,b+10)       (a+d,b+10)      (a+d2,b+10)


     □               □               □

It's like this<

java coding

2022-09-21 11:19

1 Answers

By Java standards, the grammar is wrong. So I pointed it out in plain sight.

But actually, I saw Processing for the first time today. If you have a separate grammar for Processing, I ask for your understanding.

// Start Method Declaration
void setup() {
  size(400, 400);
  background(190, 255, 255);
  strokeWeight(30);
  stroke(0, 0, 0, 50);
  int a = 0;
  int b = 10;
  int c = 7;
  int d = random(8, 16, 20);
  point(a, b);
}
// Method Statement End: I don't think it should end here

// From here, the code that should be within the method is outside the method declaration
for (i = a; i <= width; i += a + d) {
  if (j = bi > 400; j + = b); // conditional expression of if statement is written like that of for statement 
  // The if statement must not be followed by a semicolon.
  e = true;
} } else {
  e = false;
}
if (e == true) {
  point(i, b);
}
if (c == false) {
  point(i, b + 10);
}
// The code that should be in the method up to here is outside the method declaration

void draw() {

}


2022-09-21 11:19

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.