if((col+row)%2==0) {
game.getTile(row, col).setValue(2);
}else {
game.getTile(row, col).setValue(4);
game2.getTile(row, col).setValue(2);
}
Would like to turn this into a lambda expression, sorta like this;
game.getTile(row, col).setValue((row,col) -> ((row+col)%2)== 0 ? 2 : 4);
Aucun commentaire:
Enregistrer un commentaire