Skip to content

Instantly share code, notes, and snippets.

@terurou
Last active November 28, 2015 02:54
Show Gist options
  • Save terurou/4d895abdef9b26ded883 to your computer and use it in GitHub Desktop.
Save terurou/4d895abdef9b26ded883 to your computer and use it in GitHub Desktop.
NGK2015B 発表順序抽選
class Main {
static function main() {
var speakers = shuffle([
"aster_ism",
"sqm8",
"けきょ",
"niccolli",
"y_taka_23",
"mzp",
"maeda_",
"c0hama",
"可知 一輝",
"kakocom",
"bleis-tift",
"iyo_27",
"dabits",
"MasayukiTanaka",
"Sophy",
"kawaji_scratch",
"masafumiohta",
"terurou",
"youhei_yamaguchi",
"ktamura777",
"aua2008",
"くう"
]);
trace(speakers.slice(0, 6));
trace(speakers.slice(6, 12));
trace(speakers.slice(12, 18));
trace(shuffle(speakers.slice(18).concat(["NOBU_E753", "katzueno"])));
}
static function shuffle<T>(arr : Array<T>) : Array<T> {
var result = arr.copy();
var i = arr.length;
while (i > 0) {
var j = Std.random(i);
var tmp = result[--i];
result[i] = result[j];
result[j] = tmp;
}
return result;
}
}
11:49:34:078 sqm8,ktamura777,dabits,terurou,niccolli,maeda_
11:49:34:079 aua2008,bleis-tift,iyo_27,c0hama,kakocom,可知 一輝
11:49:34:079 MasayukiTanaka,mzp,youhei_yamaguchi,Sophy,y_taka_23,けきょ
11:49:34:079 katzueno,くう,NOBU_E753,kawaji_scratch,aster_ism,masafumiohta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment