public
Last active

battle language sample

  • Download Gist
gistfile1.hs
Haskell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
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]

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.