| @@ -1,6 +1,5 @@ | |||||
| package edu.stuy.goldfish; | package edu.stuy.goldfish; | ||||
| import edu.stuy.goldfish.rules.*; | import edu.stuy.goldfish.rules.*; | ||||
| public class Goldfish { | public class Goldfish { | ||||
| @@ -8,34 +7,29 @@ public class Goldfish { | |||||
| private Grid _grid; | private Grid _grid; | ||||
| private Render _render; | private Render _render; | ||||
| public Goldfish () { | |||||
| public Goldfish() { | |||||
| int height = 96; | int height = 96; | ||||
| int width = 96; | int width = 96; | ||||
| _render = new Render(width, height); | _render = new Render(width, height); | ||||
| _grid = new Grid(width, height); | _grid = new Grid(width, height); | ||||
| } | } | ||||
| public void run () { | |||||
| //TODO: make it run. | |||||
| public void run() { | |||||
| _grid.getPatch(1,0).setState(1); | _grid.getPatch(1,0).setState(1); | ||||
| _grid.getPatch(2,1).setState(1); | _grid.getPatch(2,1).setState(1); | ||||
| _grid.getPatch(2,2).setState(1); | _grid.getPatch(2,2).setState(1); | ||||
| _grid.getPatch(1,2).setState(1); | _grid.getPatch(1,2).setState(1); | ||||
| _grid.getPatch(0,2).setState(1); | _grid.getPatch(0,2).setState(1); | ||||
| System.out.println(_grid); | |||||
| _grid = LifeWithoutDeath.run(_grid); | |||||
| System.out.println("------------"); | |||||
| System.out.println(_grid); | |||||
| _render.setGrid(_grid); | |||||
| _render.run(); | |||||
| while (true) { | |||||
| _grid = Conway.run(_grid); | |||||
| _render.setGrid(_grid); | |||||
| _render.run(); | |||||
| } | |||||
| } | } | ||||
| public static void main (String[] args) { | public static void main (String[] args) { | ||||
| Goldfish g = new Goldfish(); | Goldfish g = new Goldfish(); | ||||
| while(true) { | |||||
| g.run(); | |||||
| } | |||||
| g.run(); | |||||
| } | } | ||||
| } | } | ||||