|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Contest1.Config
A class that provides support for game board parameters and initial configurations.
GameBoard
,
GameOfLife
Field Summary | |
(package private) static short |
columns
The number of columns of cells on game board. |
(package private) static byte |
come2life
The exact number of live neighbors required for a cell to come to life in the next generation. |
(package private) static byte |
hbound
The maximum number of live neighbors allowed to sustain life in next generation. |
(package private) static byte |
lbound
The minimum number of live neighbors required to sustain life in next generation. |
(package private) static short |
preferred_board_xdimension
The preferred width of game board. |
(package private) static short |
preferred_board_ydimension
The preferred height of game board. |
(package private) static short |
rows
The number of rows of cells on game board. |
(package private) static long |
sleeptime
The sleeptime for the generation loop. |
Constructor Summary | |
(package private) |
Config()
|
Method Summary | |
(package private) static void |
glider(Cell[][] board,
int column_offset)
Initialize a glider configuration near the middle row of the board. |
(package private) static void |
layoutBoard(Cell[][] board,
int[] offset)
Visually verifys the game board dimension as specified in the problem statement. |
(package private) static void |
oscillator(Cell[][] board)
Initialize an oscillator configuration near center of board. |
(package private) static void |
randomize(Cell[][] board)
Randomize the initial cell configuartion on the board. |
Methods inherited from class java.lang.Object |
|
Field Detail |
static short preferred_board_xdimension
static short preferred_board_ydimension
static short rows
static short columns
static long sleeptime
static final byte lbound
static final byte hbound
static final byte come2life
Constructor Detail |
Config()
Method Detail |
static void randomize(Cell[][] board)
board
- A two-dimensional Cell array.Cell
,
Random
static final void glider(Cell[][] board, int column_offset)
board
- A two-dimensional Cell array.column_offset
- The column offset at which to instantiate the glider.Cell
,
JavaWorld Code Masters Programming Challengestatic final void oscillator(Cell[][] board)
board
- A two-dimensional Cell array.Cell
,
JavaWorld Code Masters Programming Challengestatic void layoutBoard(Cell[][] board, int[] offset)
board
- A two-dimensional Cell array.offset
- The row and column offsets of the origin of the visible portion of the game board.
Row offset value expected in first array element, column offset value in the second array element.Cell
,
JavaWorld Code Masters Programming Challenge
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |