瀏覽代碼

Fix some widths/heights.

master
Ben Kurtovic 12 年之前
父節點
當前提交
fceb8329d0
共有 4 個檔案被更改,包括 10 行新增10 行删除
  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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存