improved display

This commit is contained in:
Lukian LEIZOUR 2024-03-02 19:18:07 +01:00
parent 8f4421bc12
commit a5090c2bcf
2 changed files with 12 additions and 8 deletions

View file

@ -210,10 +210,11 @@ public class Universe {
return this.boxes_to_fill == 0;
}
public void print() {
public void print(int pos_i, int pos_j) {
int i, j;
for (i = 0; i < this.height; i++) {
for (j = 0; j < this.width; j++) {
System.out.print("\033[" + (i + pos_i) + ";" + (j*2 + pos_j) + "H");
switch (this.grid[i][j]) {
case -1:
System.out.printf(" X");