//随机排列数组元素
public List ListRandom(List list)
{
int index = 0;
char temp ;
for (int i = 0; i < list.Count; i++)
{
index = Random.Range(0,list.Count);
if (index!=i)
{
temp = list[i];
list[i] = list[index];
list[index] = temp;
}
}
return list;
}
C#随机排列list元素
最新推荐文章于 2023-10-17 09:49:36 发布