Created
August 30, 2012 03:40
-
-
Save rugi/3522072 to your computer and use it in GitHub Desktop.
Codigo principal de la implementación del "juego de la vida" en java.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Eden { | |
public static final byte SIZE_UNIVERSE = 66; | |
public static final int HAPPY_TIME = 100; | |
public static void main(String[] args) throws InterruptedException { | |
//Requerimos una realidad para poder visualizar lo que ocurra | |
Reality realidad = new Reality(SIZE_UNIVERSE); | |
//iniciams la realidad | |
realidad.init(); | |
// Requerimos un $DEITY creador | |
Demiurgo ourobouros = new Demiurgo(); | |
//El demiurgo genera la 1a realidad | |
Cell[][] matrizInicial = ourobouros.generatePangea(SIZE_UNIVERSE); | |
do { | |
//mostramos ese mundo a través de nuestra realidad | |
realidad.muestra(matrizInicial); | |
// Damos unos segundos de felicidad | |
ourobouros.delay(HAPPY_TIME); | |
// Y ocurre un cataclismo | |
matrizInicial = ourobouros.cataclysm(matrizInicial); | |
} while (true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment