Browse Source

Fix some widths/heights.

master
Ben Kurtovic 11 years ago
parent
commit
fceb8329d0
4 changed files with 10 additions and 10 deletions
  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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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]);
}
}
}


Loading…
Cancel
Save