org.metasyntactic.games.life
Interface Life
- All Known Implementing Classes:
- FiniteUniverse
- public interface Life
|
Method Summary |
int |
getColumns()
|
int |
getRows()
|
boolean |
isLive(int row,
int column)
Returns true if and only if the cell is live in that row and column. |
int |
livingNeighbors(int row,
int column)
Returns the number of cells that are alive in the 8 cells surrounding the cell in
(row,column). |
void |
setLive(int row,
int column,
boolean live)
|
void |
simulate()
|
void |
simulate(int steps)
|
isLive
public boolean isLive(int row,
int column)
- Returns true if and only if the cell is live in that row and column.
setLive
public void setLive(int row,
int column,
boolean live)
getRows
public int getRows()
getColumns
public int getColumns()
livingNeighbors
public int livingNeighbors(int row,
int column)
- Returns the number of cells that are alive in the 8 cells surrounding the cell in
(row,column). Note: it is implementation specific how boundary conditions will be handled.
simulate
public void simulate(int steps)
simulate
public void simulate()