You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Life.java 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. public class Life implements ILife {
  2. public static void main(String[] args) {
  3. Life l = new Life(new String[] { " ",
  4. " ",
  5. " *** ",
  6. " ",
  7. " " });
  8. l = (Life) l.nextGeneration();
  9. }
  10. public Life() {
  11. nukeAll();
  12. }
  13. public Life(String[] setup) {
  14. this();
  15. for (int y = 0; y < setup.length; y++)
  16. for (int x = 0; x < setup[y].length(); x++)
  17. if (setup[y].charAt(x) != ' ')
  18. setAlive(x, y);
  19. }
  20. @Override
  21. public void nukeAll() {
  22. // TODO Auto-generated method stub
  23. }
  24. @Override
  25. public void setAlive(int x, int y) {
  26. // TODO Auto-generated method stub
  27. }
  28. @Override
  29. public void setDead(int x, int y) {
  30. // TODO Auto-generated method stub
  31. }
  32. @Override
  33. public boolean isAlive(int x, int y) {
  34. // TODO Auto-generated method stub
  35. return false;
  36. }
  37. @Override
  38. public ILife nextGeneration() {
  39. // TODO Auto-generated method stub
  40. return null;
  41. }
  42. }