Home > A Coder's Guide to Life > Getting Pulled Over

Getting Pulled Over

September 9th, 2010

You’re just cruisin along, thinking of your latest killer app idea, when lights start flashing behind you. After the initial burst of adrenaline pierces you to the core and shortens your breath, you briefly stop to consider the technology of the trailing officer’s light bar (rotating beacons or LEDs). But then you manage to pull yourself out of your internal dialog, which was going over LEDs superiority as a light-bar technology, given its better visibility, no moving parts, and more efficient energy usage. What do you do next?

The first part is relatively straightforward:

try
{
    You.PullOver();
}
catch(RetardException e)
{
    Officer.Arrest(You);  /// Do not pass go, do not collect $200
}

The next part gets a little more complex:

float getTicket()
{
    float fine = officer.GetFine(you.Speed - context.SpeedLimit);

    while (officer.IsTalking)
    {
        try {
            if (you.Gender == "Male")
                you.PolitelyAgree();
            else if (You.Gender == "Female")
                you.FakeDistressedSobbing();
            else
                /// ?

            if (officer.LetOffWithWarning(you))
            {
                fine = 0;
                break;
            }
        }
        catch (UncooperativeException e)
        {
            if (e.MyTaxesPayYourSalary == true)
                fine *= 2;
            else
                fine *= 1.2;
            break;
        }
    }
    
    return fine;
}

The elusive black box that is the officer’s LetOffWithWarning() function (highlighted above) is probably of particular interest. It’s probably a combination of factors involving the mind set of the officer as well as your behavior and is probably worth much deeper research. The dramatic sobbing attempts (which, as seen above, only work if you’re a woman) are an attempt to incite a true return value for LetOffWithWarning. Everything else is pretty much targeted at keeping you out of jail.

A Coder's Guide to Life

  1. No comments yet.
  1. No trackbacks yet.