I'm new to Processing. Why don't I see the first matrix drawn? I seem to only see the matrix after the delay, and not the one before. My ultimate goal is to watch how a matrix changes over time steps.
- // Number of columns and rows in the grid
- int[][] myArray = { {0, 1, 2, 3},
- {3, 2, 1, 0},
- {3, 5, 6, 1},
- {3, 8, 3, 4} };
- void setup() {
- size(200,200);
- }
- void draw() {
- background(204);
- for (int i = 0; i < 4; i++) {
- for (int j = 0; j < 4; j++) {
- rect(20+30*j,30+30*i,3,3);
- }
- }
- delay(2500);
- background(204);
- for (int i = 0; i < 4; i++) {
- for (int j = 0; j < 4; j++) {
- rect(40+30*j,50+30*i,7,7);
- }
- }
- }
1