Chicken Egg Tracking - Coding help

But don't you first have to solve for:

Note, not tested:

if(cameFirst)
   {
    chicken = FALSE;
    egg = TRUE;
   }
 else
   {
    chicken = TRUE;
    egg = FALSE;
   }

Lefty