martes, marzo 18, 2008

Vida

/*****************************************************
*
* Procedure vida. Created by GOD on Jan 01, 6400M bc
*
*/

vivo = TRUE;
edad = 0;
dias = {'L', 'M', 'X', 'J', 'V', 'S', 'D'};

while (vivo)
{
for (int semana = 1; semana <53; semana++)
{
for (int i=0; i<7; i++)
{
if (is_fiesta(semana))
i=6; //domingo
switch (dias[i])
{
case 'L':
case 'M':
case 'X':
case 'J':
case 'V':
trabajo();

case 'S':
case 'D':
ocio();

case default:
problemas();
movidas();
}
}
}
edad ++;

// Life facts
is_too_big(edad)?vivo = FALSE;
time_to_marry()?marry():enjoy();
time_for_children()?fork();

/* TO DO: increment happiness exponentially */
/* TO DO: minimize the calls to functions "problems" and "movidas" */
}

2 comentarios:

Alvaro dijo...

Esta es la entrada mas friki que he visto en un blog en mucho tiempo!! jajaja
Enhorabuena! Veo que me has hecho caso en lo de las lineas de codigo... y lo has llevado al limite! :)

Anónimo dijo...

Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the Home Broker, I hope you enjoy. The address is http://home-broker-brasil.blogspot.com. A hug.