Created
May 4, 2019 17:27
-
-
Save dmwit/8422ef509996c4e27ce045a26ec7ce29 to your computer and use it in GitHub Desktop.
cryptol code to solve https://puzzling.stackexchange.com/q/83601/8871; use `cryptol 83601.cry -c ':sat isSolution'` to run it
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
isSolution w o n e = all isDigit [w,o,n,e] /\ no*won*won == wonewon /\ no != 0 where | |
no = fromDigits [o,n] | |
won = fromDigits [n,o,w] | |
wonewon = fromDigits [n,o,w,e,n,o,w] : [32] | |
isDigit x = 0 <= x /\ x <= 9 | |
fromDigits digits = sum [digit * 10^^exp | digit <- digits | exp <- [0...]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And here's the output: