Skip to content

Instantly share code, notes, and snippets.

@mwotton
Created June 4, 2011 07:41
Show Gist options
  • Save mwotton/1007703 to your computer and use it in GitHub Desktop.
Save mwotton/1007703 to your computer and use it in GitHub Desktop.
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