Wednesday, March 01, 2006

ill void YOU

somebody fix this function for me. It's supposed to play a skip-3 solitaire game. Basically you deal out cards one at a time in a row. if the card you just dealt has the same suit or rank as either the previous card or the card 3rd previous card, you take the card you just dealt and put it on top of the stack it is equal to.


void rowOfCards::consolidate()
{
node*p = data.begin();
p=p->next;
node*p3 = p;
while(p!=NULL)
{
if (data.size() > 3)
{
p3 = p->prev;
p3 = p->prev;
p3 = p->prev;
}
if (data.begin()->val == p->val)
{
p->val = data.begin()->val;
data.erase(p);
p=data.begin();
}
//else if(data.begin()->val == p3->val)
//{
// p3->val = data.begin()->val;
// data.erase(p3);
// p3=data.begin();
//}
p=p->next;
}
}

1 comment:

your Harlot said...

...you represent the epitome of Desperation and Lameness...