Skip to content

Instantly share code, notes, and snippets.

@alexserver
Forked from ZeroDragon/Genesis.GOD
Last active December 27, 2015 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexserver/7254389 to your computer and use it in GitHub Desktop.
Save alexserver/7254389 to your computer and use it in GitHub Desktop.
//Así se creó el mundo version Programador... (se vale contribuir en los comentarios)
//tambien pueden hacer un fork y luego hacemos un merge :P
//Genesis... Documentación en http://iglesia.net/biblia/libros/genesis.html
1:0 void();
1:1 BEGIN
tierra = new Earth();
cielo = new Heaven();
1:2 tierra.oscuridad = true;
tierra.agua = new Water();
1:3 tierra.luz = new Light();
tierra.luz.active = true; //:megusta:
1:4 tierra.sombra = tierra.luz.color().substract( tierra.oscuridad.color() ) //la luz menos oscuridad generan sombra.
1:5 DEFINE DIA = tierra.luz, NOCHE = tierra.oscuridad;
DIA.contador = 1;
1:6 aguas = tierra.agua.split('expansion');
1:7 aguaAbajo = aguas[0];
aguaArriba = aguas[1];
1:8 aguas.push();
DEFINE cielo = { nubes: true, luna: true, sol: true, color: "#7ED5F7" };
cielo.cielos = aguas[2];
DIA.contador += 1; //van dos
1:9 tierra.aguas[0].join('seco');
seco = [];
tierra.aguas.forEach(agua,k){
if(!agua.humedo){
seco.push()
}
}
1:10 DEFINE TIERRA.tierra = seco;
DEFINE MARES.aguas = aguaAbajo //:megusta:
1:11 hierba = function(kernel,size,cnt,output){
color = 'verde';
arbol = execute(kernel);
fruta = arbol.fruta;
output.push([color,arbol,fruta]);
cnt += 1;
(cnt<=size) ? hierba(fruta.semilla,size,cnt,output) : return output; //esto va a estar bueno
};
semilla = options_from_collection('Arboles','todos').kernel();
1:12 TIERRA.tierra.forEeach(tierra,k){
tierra[k] = hierba(semilla,tierra[k].length,0,[]);
};
1:13 DIA.contador +=1; //van tres
1:14 CIELOS.luces =[];
CIELOS.luces.push(new Light('big));
CIELOS.luces.push(new Light('small));
1:15 TIERRA.luces = CIELOS.luces;
1:16 DIA.luz = TIERRA.luces[0]; //la grande va para el día
NOCHE.luz = TIERRA.luces[1]; //la peque va para la noche
estrellas = new Stars();
1:17 Cielos.luces.push(estrellas); //si las pongo acá también se ven desde la TIERRA
1:18 //entonces: en el DIA hay luz grande, en la NOCHE hay luz pequeña y las estrellas :megusta:
1:19 DIA.contador +=1; //van cuatro
1:20 MARES.animales = options_from_collection('Animales','marinos');
TIERRA.animales = options_from_collection('Animales','aves');
1:21 MARES.animales.forEach(animal,k){
animal.reproduce = function(otro){
nuevo = animal.kernel.merge!(otro.kernel);
if(MARES.animales.length<=MARES.aguas.length){
MARES.aguas.push(nuevo);
}
}
}
TIERRA.animales.forEach(animal,k){
animal.reproduce = function(otro){
nuevo = animal.kernel.merge!(otro.kernel);
if(TIERRA.animales.length<=TIERRA.tierra.length){
TIERRA.tierra.push(nuevo);
}
}
}
1:22 bendicion = function(animal, otroAnimal){
animal.reproduce(otroAnimal);
}
//a reproducirse hasta que se llene todo
MARES.animales.forEach(animal,k){
MARES.animales.forEach(animal,i){
bendicion(animal[k],animal[i]);
}
}
TIERRA.animales.forEach(animal,k){
TIERRA.animales.forEach(animal2,i){
bendicion(animal[k],animal2[i]);
}
}
1:23 DIA.contador += 1; //YAY es viernes, vámonos de peda!.. ah si aun no hago esa función...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment