Procházet zdrojové kódy

Fix some widths/heights.

master
Ben Kurtovic před 12 roky
rodič
revize
fceb8329d0
4 změnil soubory, kde provedl 10 přidání a 10 odebrání
  1. +4
    -4
      src/Render.java
  2. +2
    -2
      src/rules/BriansBrain.java
  3. +2
    -2
      src/rules/Conway4.java
  4. +2
    -2
      src/rules/LifeWithoutDeath.java

+ 4
- 4
src/Render.java Zobrazit soubor

@@ -232,8 +232,8 @@ public class Render extends Canvas implements Runnable, MouseListener,
public void clear() {
acquireLock(1);
for (int i = 0; i < _grid.getHeight(); i++) {
for (int j = 0; j < _grid.getWidth(); j++) {
for (int i = 0; i < _grid.getWidth(); i++) {
for (int j = 0; j < _grid.getHeight(); j++) {
_grid.getPatch(i, j).setState(0);
}
}
@@ -242,8 +242,8 @@ public class Render extends Canvas implements Runnable, MouseListener,
public void randomize() {
acquireLock(1);
for (int i = 0; i < _grid.getHeight(); i++) {
for (int j = 0; j < _grid.getWidth(); j++) {
for (int i = 0; i < _grid.getWidth(); i++) {
for (int j = 0; j < _grid.getHeight(); j++) {
_grid.getPatch(i, j).setState(random.nextInt(Goldfish.getMaxStates(rule)));
}
}


+ 2
- 2
src/rules/BriansBrain.java Zobrazit soubor

@@ -32,8 +32,8 @@ public class BriansBrain extends RuleSet {
};
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 3; j++) {
g.getPatch(i + ((g.getHeight() - 5) / 2),
j + ((g.getWidth() - 3) / 2)).setState(pattern[j][i]);
g.getPatch(i + ((g.getWidth() - 5) / 2),
j + ((g.getHeight() - 3) / 2)).setState(pattern[j][i]);
}
}
}


+ 2
- 2
src/rules/Conway4.java Zobrazit soubor

@@ -33,8 +33,8 @@ public class Conway4 extends RuleSet {
};
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 2; j++) {
g.getPatch(i + ((g.getHeight() - 6) / 2),
j + ((g.getWidth() - 2) / 2)).setState(pattern[j][i]);
g.getPatch(i + ((g.getWidth() - 6) / 2),
j + ((g.getHeight() - 2) / 2)).setState(pattern[j][i]);
}
}
}


+ 2
- 2
src/rules/LifeWithoutDeath.java Zobrazit soubor

@@ -29,8 +29,8 @@ public class LifeWithoutDeath extends RuleSet {
};
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 2; j++) {
g.getPatch(i + ((g.getHeight() - 6) / 2),
j + ((g.getWidth() - 2) / 2)).setState(pattern[j][i]);
g.getPatch(i + ((g.getWidth() - 6) / 2),
j + ((g.getHeight() - 2) / 2)).setState(pattern[j][i]);
}
}
}


Načítá se…
Zrušit
Uložit