i want to move my shape on my console like they are falling down. what i tired doing is looping the shape 3 times issue is the top shapes still remain i do i delete/remove the previous shape or change there visibility? i was told you cant do that, then i want to know how do i go about this then and why cant i do so? hope this makes sense.
class Pyramid extends Thread {
//shape length
static int shapeLength = 10;
//symbol for shape
static String symbol = "$";
static int m = 0;
static int k;
public static void move() throws Exception {
//printing shape multiple times
for (int m = 0; m < 3; m++) {
try {
Thread.sleep(500);
//geting shape lenth
for (int i = 0; i <= shapeLength; i++) {
//get shape size
for (int j = 0; j <= shapeLength - i; j++) {
//changing shape to 90 degress
System.out.print(" ");
}
//getting size
for (int k = 0; k <= i; k++) {
//giving space between symbol
System.out.print(symbol + " ");
}
//making triangle shape
System.out.println();
}
} catch (Exception e) {
System.out.println(e);
}
}
}
public static void main(String[] args) throws Exception {
move();
}
}