Sfoglia il codice sorgente

Fix some widths/heights.

master
Ben Kurtovic 12 anni fa
parent
commit
fceb8329d0
4 ha cambiato i file con 10 aggiunte e 10 eliminazioni
  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 Vedi 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 Vedi 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 Vedi 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 Vedi 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]);
}
}
}


Caricamento…
Annulla
Salva