HSP - Hot Soup Processor [14]at GAMEDEVHSP - Hot Soup Processor [14] - 暇つぶし2ch■コピペモード□スレを通常表示□オプションモード□このスレッドのURL■項目テキスト469:名前は開発中のものです。 07/02/22 21:09:48 5nAwOm3S なんじゃそら データの無音時間が長いんじゃねえの 470:名前は開発中のものです。 07/02/22 21:44:16 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 471:名前は開発中のものです。 07/02/22 23:23:00 MHAA7b9m #define ALL 43 //0~42の合計43個から #define NEED 6 //6個選ぶとして if ALL < NEED : dialog "ALL が NEED 未満\nALL="+ALL+" NEED="+NEED,1,"MyError!" : end //初期化 dim a, ALL repeat ALL : a(cnt) = cnt : loop //シャッフル randomize repeat NEED idx = rnd(ALL-cnt)+cnt //←*******ここ、これでもいけるんじゃね?********* //ここで2つをスワップ tmp = a(cnt) : a(cnt) = a(idx) : a(idx) = tmp loop //処理が終了した、結果を確認 **** sdim result, 32*ALL : notesel result repeat ALL noteadd "a[" + strf("%2d",cnt) + "] = " + a(cnt) if(cnt == NEED-1) : noteadd "↑ ここまで" loop mesbox result, ginfo_winx,ginfo_winy, 0 次ページ最新レス表示レスジャンプ類似スレ一覧スレッドの検索話題のニュースおまかせリストオプションしおりを挟むスレッドに書込スレッドの一覧暇つぶし2ch