<?php

// Ben's 1st approximation to females 
// and in particular, relationships with them (a famously intractible problem)
// actual complexity = O(n!!!)
// Modified: 5-Sept-04, 6-Sept-04 (cheers Martin, Phil)

// start with the ingredients
include "sugar.php";
include 
"spice.php";
include 
"all-things-nice.php";

// find them!
while(count($girls_you_like) < 1)
{
   if ((
$gender == 'm' && ($heterosexual||$bisexual)) || ($gender == 'f' && ($homosexual||$bisexual)))
   {
      
$standards--;
      
$girls_you_like shop_around();
   }
   else
   {
      echo(
"This algorithm doesn't support heterosexual females / homosexual males");
      exit(
1);
   }
}


foreach (
$girls_you_like as $girl_u_like)
{
   
// while loop to handle loud, club-like situations
   
$answer "";
   while (!
$answer)
   {
      
fwrite($girl_u_like"Hi there.  I fancy you.  Do you fancy me?");
      
$answer fread($girl_u_like);
      if (!
$answer || $answer == "What?" || $answer == "Huh?")
      {
         
$volume++;
         
$answer "";
      }
   }

   if (
ereg('^Yes[,\. !]'$answer)
   {
      
//FIXME: what if they are saying "Yes, but I have a heavyweight boxer for a boyfriend"?

      
$gf $girl_u_like;
      while(
$gf != NULL)
      {
         
kiss($gf);
         
cuddle($gf);
         
make_love_to($gf);
         
sleep(8*60*60);  // let's get our recommended 8 hours sleep

         
if (check_dumped($gf)) $gf NULL;
         
// NB: $gf is just a pointer to your ex-girlfriend, not your ex-girlfriend herself
         // hence setting $gf to NULL does not harm your ex-girlfriend
         // (unless no-one is pointing at her,
         //  in which case she may be removed by the garbage collector!  
         //  ... but he'd be welcome to her anyways :P )
      
}
   }
}

die(
"No more fish left in the sea.  Commiting suicide...");

?>