- 470 名前:名前は開発中のものです。 mailto:sage [2007/02/22(木) 21:44:16 ID:TMK/38nP]
- >>466 そぉい!
#define ALL 43 //0~42の合計43個から #define NEED 6 //6個選ぶとして dim a, ALL repeat ALL a(cnt) = cnt loop repeat NEED idx = rnd(ALL-(cnt+1)) idx += (cnt+1) //ここで2つをスワップ tmp = a(cnt) a(cnt) = a(idx) a(idx) = tmp loop //処理が終了した、結果を確認 **** repeat ALL mes "a[" + cnt + "] = " + a(cnt) if(cnt == (NEED-1)): mes "↑ ここまで" loop
|

|