Live output

The rectangle is 50px wide and 50px high.

Editable code

Press Esc to move focus away from the code area (Tab inserts a tab character).

Let's try the following:

  1. Change the line that calculates x so the box is still 50px wide, but the 50 is calculated using the numbers 43 and 7 and an arithmetic operator.
  2. Change the line that calculates y so the box is 75px high, but the 75 is calculated using the numbers 25 and 3 and an arithmetic operator.
  3. Change the line that calculates x so the box is 250px wide, but the 250 is calculated using two numbers and the remainder (modulo) operator.
  4. Change the line that calculates y so the box is 150px high, but the 150 is calculated using three numbers and the subtraction and division operators.
  5. Change the line that calculates x so the box is 200px wide, but the 200 is calculated using the number 4 and an assignment operator.
  6. Change the line that calculates y so the box is 200px high, but the 200 is calculated using the numbers 50 and 3, the multiplication operator, and the addition assignment operator.