-
-
Save jroesch/3882778 to your computer and use it in GitHub Desktop.
ACM Micro-Challenge 1
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
-- JRo | |
nPizza p s t = ceiling $ (/ s) $ if t `elem` [11..23] then p * 2 else p | |
-- dumb tests runTests will tell you weather you pass or fail all tests, could do a fold and keep the state of which failed. | |
between12am11am = 2 == (nPizza 10 5 0) && 1 == nPizza 10 10 1 && 1 == nPizza 7 12 10 | |
between11am11pm = 4 == (nPizza 20 10 11) && 2 == (nPizza 7 12 15) | |
after11pm = 1 == nPizza 5 10 23 | |
runTests = between12am11am && between11am11pm && after11pm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment