Test.java 780 Bytes
package preypredator;

import java.util.Random;

public class Test {
	
	public static final int grassDelay = 100;
	public static final int preyGain = 50;
	public static final int predGain = 50;
	public static final float preyRepro = 0.2f;
	public static final float predRepro = 0.1f;
	
	public int[][] grass;
	public int[][] grassCounters;
	
	public int[][] preys;
	public int[][] preds;
	
	public Test() {
		Random rng = new Random();
		
		for (int i = 0; i < grass.length; i++) {
			for (int j = 0; j < grass[i].length; j++) {
				if (rng.nextBoolean()) {
					grass[i][j] = 1;
					grassCounters[i][j] = grassDelay;
				} else {
					grass[i][j] = 0;
					grassCounters[i][j] = rng.nextInt(grassDelay);
				}
			}
		}
		
		
	}
	
	public static void main(String[] args) {
	}

}