bool assigned=new bool[23];
这样声明,是否默认表示assigned=false
如果不是,下面的代码里的assigned[destCard]怎么解释呢
Card[] newcard = new Card[52];
bool[] assigned = new bool[52];
Random sourcegen = new Random();
for (int i = 0; i < 52; i++)
{
int destCard = 0;
bool foudcard = false;
while (foudcard == false)
{
destCard = sourcegen.Next(52);
if (assigned[destCard] == false)
foudcard = true;
}
assigned[destCard] = true;
newcard[destCard] = cards[i];
慕运维8079593
四季花海
相关分类