C#随机数小知识

时间:2021-12-20 04:09:33

public int[] array = new int[132] {

115,  105,106,107,108,109,110,111,112,113,114,

215,  205,206,207,208,209,210,211,212,213,214,

315,  305,306,307,308,309,310,311,312,313,314,

415,  405,406,407,408,409,410,411,412,413,414,

115,  105,106,107,108,109,110,111,112,113,114,

215,  205,206,207,208,209,210,211,212,213,214,

315,  305,306,307,308,309,310,311,312,313,314,

415,  405,406,407,408,409,410,411,412,413,414,

115,  105,106,107,108,109,110,111,112,113,114,

215,  205,206,207,208,209,210,211,212,213,214,

315,  305,306,307,308,309,310,311,312,313,314,

415,  405,406,407,408,409,410,411,412,413,414};

void Start () {

List<int> list = new List<int>();

for (int i = 0;i<array.Length/4;i++){

int num = array[Random.Range(105,array.Length)];

list.Add(num);

}

for (int i = 0; i < list.Count; i++)

{

print("xxxxxx:" + list[i]);