EZ Programing Demos

Slow motion, step by step, animated demonstrations of basic computer programing techniques

Links to topics:

Current topic:

Patterned points

This design is a rectangular matrix of points. We will be using two repeat loops here. One loop will be nested within the other. The inner loop will draw several points in a column plotting them from top to bottom. The outer loop will draw several columns of points moving the location of the columns across the graph from left to right.

 Slow  Medium  Fast 
Click 'Run' to go.

Here's how this demo works:

 

In this demo we use nested repeat loops. We will plot a column of points vertically down the graph and then move right a bit and plot another column of points. We will keep plotting columns of points till our design is done.

The very first thing in the program that happens is to set the x-coordinate to its starting position.

The outer loop then sets the y-coordinate to the top of the pattern. Then the inner loop takes over. It plots a point and then moves the y-coordinate downward so that then next cycle of the inner loop plots a point below the one last plotted.

After the inner loop is done with a column of points, we finish the outer loop by moving the x-coordinate over to the right. This makes the next cycle of the outer loop create a column of points to the right of the last column.

 

The flowchart for this demo looks like this:

 

Here is what some imaginary code for this demo might look like:

    
    x = -5;
    
    repeat(10)
    {
      y = 5;
      
      repeat(10)
      {
        point(x, y);
        
        y = y + (-1);
      }
      
      x = x + 1;
    }
    

 

Suggested next article:

At EZ Math Movie

EZ Math Movie is a site that can help you experiment with and understand many topics in mathematics. Its main feature is an interactive animated (x, y) graph that you control with an actual programing language. There are many examples and tutorials, and EZ Math Movie is crossed referenced with both EZ Programing Demos and Zona Land Education.

 

Zona Land Education is a site with explanations and interactive diagrams covering many topics in physics and mathematics. Zona Land Education is cross referenced with EZ Math Movie, and it contains several animations that use EZ Math Movie's programing language.