A4 - The while Loop
The JavaScript while loop is almost identical to the Python while loop.
It is very similar to the if statement, except the code inside will continually repeat as long as the condition is true.
General syntax:
Example of drawing a series of ellipses
Your Task
Run the update script.
Open the folder Unit 2/a4 in VS Code, then run it in Live Server to ensure it works.
It will contain the full code for the example given above, and will draw a series of ellipses.
Your task is to use while loops to try to make similar effects. Some modifications to consider:
- Use different shapes
- Get them to make a vertical and/or diagonal pattern instead of horizontal
- Try to make each shape in the pattern a slightly different colour, brightness or size