Contest1
Class Config

java.lang.Object
  |
  +--Contest1.Config

class Config
extends Object

A class that provides support for game board parameters and initial configurations.

See Also:
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
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

preferred_board_xdimension

static short preferred_board_xdimension
The preferred width of game board.

preferred_board_ydimension

static short preferred_board_ydimension
The preferred height of game board.

rows

static short rows
The number of rows of cells on game board. * @see GameBoard

columns

static short columns
The number of columns of cells on game board.

sleeptime

static long sleeptime
The sleeptime for the generation loop.

lbound

static final byte lbound
The minimum number of live neighbors required to sustain life in next generation.
See Also:
JavaWorld Code Masters Programming Challenge

hbound

static final byte hbound
The maximum number of live neighbors allowed to sustain life in next generation.
See Also:
JavaWorld Code Masters Programming Challenge

come2life

static final byte come2life
The exact number of live neighbors required for a cell to come to life in the next generation.
See Also:
JavaWorld Code Masters Programming Challenge
Constructor Detail

Config

Config()
Method Detail

randomize

static void randomize(Cell[][] board)
Randomize the initial cell configuartion on the board.
Parameters:
board - A two-dimensional Cell array.
See Also:
Cell, Random

glider

static final void glider(Cell[][] board,
                         int column_offset)
Initialize a glider configuration near the middle row of the board.
Parameters:
board - A two-dimensional Cell array.
column_offset - The column offset at which to instantiate the glider.
See Also:
Cell, JavaWorld Code Masters Programming Challenge

oscillator

static final void oscillator(Cell[][] board)
Initialize an oscillator configuration near center of board.
Parameters:
board - A two-dimensional Cell array.
See Also:
Cell, JavaWorld Code Masters Programming Challenge

layoutBoard

static void layoutBoard(Cell[][] board,
                        int[] offset)
Visually verifys the game board dimension as specified in the problem statement.
Parameters:
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.
See Also:
Cell, JavaWorld Code Masters Programming Challenge