Parcourir la source

Tabs -> Spaces

master
Ben Kurtovic il y a 12 ans
Parent
révision
e28462bcf8
1 fichiers modifiés avec 16 ajouts et 17 suppressions
  1. +16
    -17
      src/Goldfish.java

+ 16
- 17
src/Goldfish.java Voir le fichier

@@ -9,7 +9,6 @@ public class Goldfish {
private Grid _grid;
private Render _render;
private Random random = new Random();
public Goldfish() {
@@ -22,11 +21,11 @@ public class Goldfish {
public void run() {
setup(_render.rule);
while (true) {
if (_render.reset) {
setup(_render.rule);
_render.reset = false;
if (_render.reset) {
setup(_render.rule);
_render.reset = false;
}
if (!_render.paused) {
if (!_render.paused) {
String rule = _render.rule;
if (rule.equals("Conway"))
_grid = Conway.run(_grid);
@@ -42,19 +41,19 @@ public class Goldfish {
_render.sleep();
}
}
public static int getMaxStates(String rule) {
if (rule.equals("Conway"))
return Conway.states;
else if (rule.equals("Conway4"))
return Conway4.states;
else if (rule.equals("Life Without Death"))
return LifeWithoutDeath.states;
else if (rule.equals("Brian's Brain"))
return BriansBrain.states;
return 2;
public static int getMaxStates(String rule) {
if (rule.equals("Conway"))
return Conway.states;
else if (rule.equals("Conway4"))
return Conway4.states;
else if (rule.equals("Life Without Death"))
return LifeWithoutDeath.states;
else if (rule.equals("Brian's Brain"))
return BriansBrain.states;
return 2;
}
private void setup(String rule) {
if(rule.equals("Conway")) {
int[][] glidergun = {


Chargement…
Annuler
Enregistrer