Код: Выделить всё
public void create() {
setDefaultFontSize( 20 );
grade = new boolean[DIMENSAO_GRADE][DIMENSAO_GRADE];
tempoAtualizacao = 0.4;
mostrarAjuda = true;
prepararCenarioInicial();
}
Код: Выделить всё
private void prepararCenarioInicial() {
executando = false;
for ( int i = 0; i < DIMENSAO_GRADE; i++ ) {
for ( int j = 0; j < DIMENSAO_GRADE; j++ ) {
grade[i][j] = false;
}
}
int iIni = DIMENSAO_GRADE / 2 + 2;
int jIni = DIMENSAO_GRADE / 2;
// glider
grade[iIni][jIni] = true;
grade[iIni+1][jIni+1] = true;
grade[iIni+2][jIni-1] = true;
grade[iIni+2][jIni] = true;
grade[iIni+2][jIni+1] = true;
}
Код: Выделить всё
private void geraGrade(int i, int j){
int somaVivos = 0;
int ni, nj;
for(int x = - 1; x
Подробнее здесь: [url]https://stackoverflow.com/questions/79205311/global-matrix-doesnt-return-the-right-value-when-read[/url]
Мобильная версия