// Create a canvas
var canvas = createCanvas(400, 400);
// Draw a random color square
fill(color);
rectMode(CENTER);
rect(200, 200, SIDE_LENGTH, SIDE_LENGTH);
2.13.6 Random Color Square
Write a program that draws a random color square centered on the graphics canvas. The sides of the square should be SIDE_LENGTH.
(Hint: Use the Randomizer to get a random color for the square.)
Quick Docs
// Random integer between low and high
Randomizer.nextInt(low, high);
Randomizer.nextBoolean();
Randomizer.nextFloat(low, high);
Randomizer.nextColor();
var roll = Randomizer.nextInt(1,6);
var color = Randomizer.nextColor();
3 answers
i think you still have to get the random color, but you get the idea
i write js sometimes for my job. this basically makes my job obsolete lol