All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.drools.examples.conway.patterns.SimpleGlider Maven / Gradle / Ivy

The newest version!
package org.drools.examples.conway.patterns;

/**
 * Represents a simple glider
 * 
 * @author Jeff Brown
 * @see ConwayPattern
 * @see org.drools.examples.conway.CellGridImpl
 */
public class SimpleGlider
    implements
    ConwayPattern {

	private static final long serialVersionUID = 1L;
	
    private final boolean[][] grid = {{false, true, false}, {true, false, false}, {true, true, true}};
    //private final boolean[][] grid = {{false, false, false}, {true, true, false}, {false, false, false}};

    /**
     * This method should return a 2 dimensional array of boolean that represent
     * a conway grid, with true values in the positions where
     * cells are alive
     * 
     * @return array representing a conway grid
     */
    public boolean[][] getPattern() {
        return this.grid;
    }

    /**
     * @return the name of this pattern
     */
    public String getPatternName() {
        return "Simple Glider";
    }

    public String toString() {
        return getPatternName();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy