How to append in a two dimensional array?

I have a two dimensional array and I’m trying to append new values but I can’t figure out how to

int[][] prv = {{1},{1}};
int objX;
int objY;
void setup(){
size(200, 200)
}
void draw() {
  objX = mouseX;
  objY = mouseY; 
  println("objX: " + objX + ", objY: " + objY);
  println(prv);
}
void keyPressed() {
  if (key == 'e') {
    prv = append(prv, objY,objX);
  }
}

do you know any way to do this?

1 Like

Processing.org/reference/append_.html
prv = append(prv, objY, objX);:
prv = (int[][]) append(prv, new int[] { objX, objY });

3 Likes