Stories, thoughts and interesting facts as seen by Liviu Lica
ză Geex ( Smile & Explore ) » Archive of 'Oct, 2009'

Task F235 – Eternal Life Bug – Status:Solved Comments Off

If only Growing older was post incremented…

Random GiveOrTake = new Random();
int LifeSpan = 75 + GiveOrTake.Next(-25, 25);

while (Age <= LifeSpan)
{
if (DateTime.Now.Month == BirthDate.Month &&
DateTime.Now.Day == BirthDate.Day)
{
//Fixed eternal life bug
//GrowOlder(Age++);
GrowOlder(++Age);
System.Threading.Thread.Sleep(86400000);
}
}

P.S. For all you coders out there just assume that GrowOlder() sets the global Age variable to whatever it receives as parameter => no aging.

Top of page / Subscribe to new Entries (RSS) / +Liviu Lica