A matrix of numbers is drawn as a grid whose cells are darker the larger their numbers are, so the shape of the data can be seen at a glance.
Student
- Run it and open the Arrays tab: the matrix p fills row by row.
- Step through the inner loop: each new cell reads the cell above and the cell on the left (yellow) and writes the sum (green).
Teacher
- Declare a matrix with two sizes (Declare, size and size 2) and use p[i, j].
- Good examples: the multiplication table, Pascal's triangle, a game board, distances between towns.