import qualified Data.IntMap as I
import System.Random
main = do
rd
<- fmap (take 100000) rollIkasamaDice
let im
= foldr (I
.update
((Just
$!) . succ)) im0 rd
im0
= I
.fromList
$ zip [1..4] [0,0..]
rollIkasamaDice
:: IO [Int]rollIkasamaDice = do
gen <- getStdGen
let rs
= filter (/=0) $ map f
$ randomRs
(1, 16) gen
aW1wb3J0IHF1YWxpZmllZCBEYXRhLkludE1hcCBhcyBJCmltcG9ydCBTeXN0ZW0uUmFuZG9tCgptYWluIDo6IElPICgpCm1haW4gPSBkbwogIHJkIDwtIGZtYXAgKHRha2UgMTAwMDAwKSByb2xsSWthc2FtYURpY2UKICBsZXQgaW0gID0gZm9sZHIgKEkudXBkYXRlICgoSnVzdCAkISkgLiBzdWNjKSkgaW0wIHJkCiAgICAgIGltMCA9IEkuZnJvbUxpc3QgJCB6aXAgWzEuLjRdIFswLDAuLl0KICBwcmludCBpbQoKcm9sbElrYXNhbWFEaWNlIDo6IElPIFtJbnRdCnJvbGxJa2FzYW1hRGljZSA9IGRvCiAgZ2VuIDwtIGdldFN0ZEdlbgogIGxldCBycyAgPSBmaWx0ZXIgKC89MCkgJCBtYXAgZiAkIHJhbmRvbVJzICgxLCAxNikgZ2VuCiAgICAgIGYgeCB8IHggPiA0ID0gZmxvb3IgJCBzcXJ0ICQgZnJvbUludGVncmFsIHgKICAgICAgICAgIHwgb3RoZXJ3aXNlICAgICAgICAgICAgPSB4CiAgcmV0dXJuIHJz