Created
June 4, 2011 07:41
-
-
Save mwotton/1007703 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| solve :: [Int] -> Bool | |
| solve (0:_) = error "stop playing around" | |
| solve (_:pd:0:_) = pd == 0 -- if we've never won any ever, we can't have won today | |
| solve (_:pd:100:_) = pd == 100 -- if we've never lost, we can't have lost today | |
| solve (n:pd:_) = d_step <= n | |
| where d_step = dotrace $ product $ primeFactors 100 \\ (primeFactors pd) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment