Skip to content

Instantly share code, notes, and snippets.

@rugi
Created August 30, 2012 03:40
Show Gist options
  • Save rugi/3522072 to your computer and use it in GitHub Desktop.
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.
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