Random color square JavaScript

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.)

What am I doing wrong?
var SIDE_LENGTH = 100;

function start(){

var square = new Rectangle (100,100);

var x = getWidth()/2;

var y = getHeight()/2;

square.setPosition(x,y);

var color = Randomizer.nextColor();

square.setColor(color);

add(square);

}

1 answer

start();
Similar Questions
  1. Random color square JavaScriptWrite a program that draws a random color square centered on the graphics canvas. The sides of the
    1. answers icon 0 answers
  2. Random color square JavaScriptWrite a program that draws a random color square centered on the graphics canvas. The sides of the
    1. answers icon 1 answer
  3. 2.13.6 Random Color SquareWrite a program that draws a random color square centered on the graphics canvas. The sides of the
    1. answers icon 3 answers
    1. answers icon 2 answers
more similar questions