fixed errors in table

This commit is contained in:
Guillaume BONABAU 2024-04-10 17:05:12 +02:00
parent cd3480ad71
commit 5f8a768283
1 changed files with 5 additions and 5 deletions

View File

@ -31,8 +31,8 @@ public class Table {
return table.get(x).get(y);
}
//TODO-complete : set(Cell, x, y) set an object Cell to coordinate x, y
public void setCell(Cell cell, int x int y){
this.table.get(x).get(y) = cell;
public void setCell(Cell cell, int x, int y){
this.table.get(x).set(y,cell);
}
//TODO-complete : count near (xy) -> return how many cells around this cell
public int countNear(int x, int y){
@ -40,13 +40,13 @@ public class Table {
// if border is true
for (int i = x-1;i<=x+1;i++){
for (int j = y-1;j<=y+1;y++){
if not(i == j){
this.table.getCell(i,j).getValue +=cellCount;
if (!(i == j)){
cellCount += this.getCell(i,j).getValue();
}
}
}
return cellCount;
//if border is false
}