다른 게임으로 Game of Life를 만들고자하는데 문제가 생겼습니다. 색인 행이있는 상자에 살아있는 사람이 있는지 확인하고 싶습니다. col. 어떻게 해야할지 모르겠어요다른 클래스의 Java에서 "Game of Life"만들기
public class LifeBoard {
private int rows;
private int cols;
private int generation;
/**Creates a playing field with rows as rows and cols as columns.
The counter for generations is 1.*/
public LifeBoard(int rows, int cols) {
this.rows = rows;
this.cols = cols;
this.generation = 1;
}
/**Checks if there's a living individual in the box row, col*/
public boolean get(int row, int col) {
if(this.board[row][col] == null){
return false;
} else {
return true;
}
}
}
:
여기에 지금까지 내 코드입니다. 이걸 어떻게 확인합니까?
귀하의 질문이 너무 광범위합니다. "특정 응용 프로그램을 어떻게 만들 수 있습니까?"와 같은 질문이 아닌 특정 엔지니어링 질문을 시도해보십시오. –