33 lines, 12 of them comments ยท 325 tokens, written in 9 seconds for $0.0004


 1  // p5.js Template
 2  // This is a basic template to get you started with p5.js
 3  
 4  function setup() {
 5    // Create a canvas that fills the window
 6    createCanvas(windowWidth, windowHeight);
 7    
 8    // Set background color (light gray)
 9    background(220);
10    
11    // Set text properties
12    textSize(32);
13    textAlign(CENTER, CENTER);
14    
15    // Draw a simple shape
16    fill(255, 0, 0); // Red color
17    noStroke();
18    ellipse(width/2, height/2, 100, 100);
19    
20    // Add some text
21    fill(0); // Black color
22    text('Hello p5.js!', width/2, height/2 + 100);
23  }
24  
25  function draw() {
26    // The draw loop runs continuously
27    // Empty for now, but you can add animations here
28  }
29  
30  function windowResized() {
31    // Resize canvas when window is resized
32    resizeCanvas(windowWidth, windowHeight);
33  }