Class Automata

    • Constructor Detail

      • Automata

        @ConstructorProperties({"height","width"})
        public Automata​(int height,
                        int width)
        Parameters:
        height - The extent of the y-axis.
        width - The extent of the x-axis.
    • Method Detail

      • getHeight

        public int getHeight()
        Method to get the height of the board.
        Returns:
        The height.
      • getWidth

        public int getWidth()
        Method to get the width of the board.
        Returns:
        The width.
      • next

        public BigInteger next​(BigInteger current)
        Given the current state, calculate the next state.
        Parameters:
        current - The current state.
        Returns:
        The next state.
      • get

        public boolean get​(BigInteger state,
                           int y,
                           int x)
        Method to get the value of a cell at a specified (y, x) coordinate fron the argument state.
        Parameters:
        state - The Automata state.
        y - The y coordinate.
        x - The x coordinate.
        Returns:
        true if the (y, x) coordinate is valid and if the specified cell is "alive;" false otherwise.