Code not running

so i just downloadd processing for school,i am not all too familiar with coding but everytime I click run, its a blank grey square canvas. how to fix this?

1 Like

Welcome to the forum.

Please post you’re code in code tags using the </> button.

Yeah start your Code (or your setup() function) with size(800,600);

Maybe that will help

2 Likes

Yes it did thank you

1 Like

I am glad to hear that.

And welcome to the forum, great to have you here!

Example 1

here is an example WITHOUT setup(), in so called static mode

size(640, 360);  // Size should be the first statement

float y = 180;

background(0, 255, 0);  // Set the background to Green

line(0, y,width, y);
line(100, y+66,width, y+66);

Example 2

and a complex Sketch with setup() and draw() which is a dynamic Sketch:



float y = 180;

// The statements in the setup() function
// run once when the program begins
void setup() {
  size(640, 360);  // Size should be the first statement in setup()
  stroke(255);     // Set stroke color to white
}

// The draw() function runs on and on
void draw() {
  background(0);  // Set the background to black

  line(0, y, width, y);
  y = y - 1;
  if (y < 0) {
    y = height;
  }
}

Warm regards,

Chrisir

2 Likes

If you did not enter any code or did not use size() this is the default output with a size of 100x100:

Keep working at it!

:)