Create a gist now

Instantly share code, notes, and snippets.

battle language sample
import Control.Monad
import Data.List
-- http://xkcd.com/287/
-- On voudrait pour 15.05 € de tapas; SVP
menu = [("gambas" ,215),
("aceitunas" ,275),
("choquitos" ,335),
("empanada" ,355),
("jamon" ,420),
("tortilla" ,580)]
main = print $ head $
[ map fst y |
i <- [1..],
y <- replicateM i menu,
sum (map snd y) == 1505]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment