int iCount = 13;
int iArray[14] = {0};
int iValue = 0;
int iPos= 1;
while (iCount >1)
{
if (iArray[iPos] == 0)
{
iValue ++;
}
if (iValue == 3)
{
iValue =0;
iArray[iPos] = 1;
iCount--;
}
iPos++;
if (iPos > 13)
{
iPos = 1;
}
}
int ii=1;
while (iArray[ii] != 0)
{
ii++;
}
int iArray[14] = {0};
int iValue = 0;
int iPos= 1;
while (iCount >1)
{
if (iArray[iPos] == 0)
{
iValue ++;
}
if (iValue == 3)
{
iValue =0;
iArray[iPos] = 1;
iCount--;
}
iPos++;
if (iPos > 13)
{
iPos = 1;
}
}
int ii=1;
while (iArray[ii] != 0)
{
ii++;
}