|
//混乱扑克
VOID CGameLogic::UpsetCards(BYTE cbCardBuffer[], BYTE cbBufferCount)
{
//混乱准备
BYTE cbCardData[cbBufferCount];
CopyMemory(cbCardData,cbCardBuffer,cbBufferCount);
//混乱扑克
BYTE cbRandCount=0,cbPosition=0;
do
{
cbPosition=rand()%(cbBufferCount-cbRandCount);
cbCardBuffer[cbRandCount++]=cbCardData[cbPosition];
cbCardData[cbPosition]=cbCardData[cbBufferCount-cbRandCount];
} while (cbRandCount<cbBufferCount);
return;
}
|
|