Ari Rahikkala (ari_rahikkala) wrote,
Ari Rahikkala
ari_rahikkala

14:12 <@Dolphin> ari: BASICALLY, RUSSIA IS LIKE YOUR VERSION OF MEXICO (FROM A USA STANDPOINT).

Also, I need to put this somewhere public so I don't have to keep digging it up from IRC logs:

let frl=fst.rootLabel; queue=map(flip Node []).map(length&&&take 1).group.sort; cmb n xs=let (b,e)=splitAt n xs in (Node (sum$map frl b, []) b):e; tree n=head.head.dropWhile(not.null.tail).iterate(cmb n.sortBy(comparing frl)); rpl ss acc (Node (_,a) [])=[(acc,a)]; rpl ss acc (Node _ ns)=concat$zipWith(\s n->rpl ss (s:acc) n) ss ns; hfm ss=rpl ss "".tree (length ss).queue

... OK, so it's not that impressive, but hey, it *is* short enough that I could feed it to lambdabot on Freenode and even have space for arguments :p
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments