At the risk of turning this in to a GTKY node, here it is (in C++):

node * first = FirstNode;
node * current = first;
if(current->next == NULL)
        cout << "There's only one item, idiot";
else
{
        bool Loops = false;
        while(current->next != NULL && current->next != first)
        {
                current = curent->next;
                if(current->next == first)
                        Loops = true;
        }

        if(Loops)
                cout << "Yep, it loops";
        else
                cout << "Nope, it don't loop";
}