【激突】関数型言語 VS オブジェクト指向言語2
■ このスレッドは過去ログ倉庫に格納されています
0782デフォルトの名無しさん
2012/05/14(月) 19:41:29.94最低 10ガチャ、最高 156ガチャ、頻度最多は 23ガチャで 45475回出現。
1.8GHz Core i7 で 66秒程度。(CogVM 使用)
| N M histo cards time |
N := 10.
M := 1000000.
histo := Bag new.
cards := 1 to: N.
time := [
M timesRepeat: [
| player |
player := Bag new.
[player add: cards atRandom; includesAllOf: cards] whileFalse.
histo add: player size]
] timeToRun.
^{time. histo min. histo max. histo sortedCounts first} "=> {66128 . 10 . 156 . 45475->23} "
■ このスレッドは過去ログ倉庫に格納されています