import qualified Data.IntMap as I
import Data.List
import System.Random
main = do
rd <- replicateM 100000 rollIkasamaDice
let im
= foldr (I
.update
((Just
$!) . succ)) im0 rd
im0
= I
.fromList
$ zip [1..4] [0,0..]
rollIkasamaDice
:: IO IntrollIkasamaDice = do
d
<- getStdRandom
(randomR
(0, 1)) :: IO Double
aW1wb3J0IHF1YWxpZmllZCBEYXRhLkludE1hcCBhcyBJCmltcG9ydCBDb250cm9sLk1vbmFkCmltcG9ydCBEYXRhLkxpc3QKaW1wb3J0IERhdGEuTWF5YmUKaW1wb3J0IFN5c3RlbS5SYW5kb20KCm1haW4gOjogSU8gKCkKbWFpbiA9IGRvCiAgcmQgPC0gcmVwbGljYXRlTSAxMDAwMDAgcm9sbElrYXNhbWFEaWNlCiAgbGV0IGltICA9IGZvbGRyIChJLnVwZGF0ZSAoKEp1c3QgJCEpIC4gc3VjYykpIGltMCByZAogICAgICBpbTAgPSBJLmZyb21MaXN0ICQgemlwIFsxLi40XSBbMCwwLi5dCiAgcHJpbnQgaW0KCnJvbGxJa2FzYW1hRGljZSA6OiBJTyBJbnQKcm9sbElrYXNhbWFEaWNlID0gZG8KICBkIDwtIGdldFN0ZFJhbmRvbSAocmFuZG9tUiAoMCwgMSkpIDo6IElPIERvdWJsZQogIGxldCB0aHIgPSBzY2FubDEgKCspICQgbWFwIC4gZmxpcCAoLykgPTw8IHN1bSAkIG1hcCBzcXJ0IFsxLi40XQogICAgICBhICAgPSB6aXAgdGhyIFsxLi5dIDo6IFsoRG91YmxlLCBJbnQpXQoKICByZXR1cm4gJCBzbmQgJCBmcm9tSnVzdCAkIGZpbmQgKChkIDw9KSAuIGZzdCkgYQo=