Created
March 1, 2012 08:24
-
-
Save abailly/1948301 to your computer and use it in GitHub Desktop.
battle language sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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